Class ResumedAuthenticationToken

java.lang.Object
se.swedenconnect.spring.saml.idp.authentication.provider.external.ResumedAuthenticationToken
All Implemented Interfaces:
Serializable, Principal, org.springframework.security.core.Authentication

public class ResumedAuthenticationToken extends Object implements org.springframework.security.core.Authentication
A special purpose Authentication token that is used when the user returns to the authentication flow after "external" authentication.
Author:
Martin Lindström
See Also:
  • Constructor Details

    • ResumedAuthenticationToken

      public ResumedAuthenticationToken(org.springframework.security.core.Authentication authnToken)
      Constructor setting up the token to represent a successful authentication
      Parameters:
      authnToken - the authentication object
    • ResumedAuthenticationToken

      public ResumedAuthenticationToken(Saml2ErrorStatusException error)
      Constructor setting up the token to represent an authentication error.
      Parameters:
      error - the error
  • Method Details

    • getAuthnToken

      public org.springframework.security.core.Authentication getAuthnToken()
      Gets the authentication token the represents the user authentication (from the external process).
      Returns:
      an Authentication object or null if this object represents an authentication error
    • getError

      public Saml2ErrorStatusException getError()
      If this authentication object represents an authentication error the method returns this error.
      Returns:
      a Saml2ErrorStatusException or null if this object represents a successful authentication
    • getAuthnInputToken

      public Saml2UserAuthenticationInputToken getAuthnInputToken()
      Gets the Saml2UserAuthenticationInputToken for this operation.
      Returns:
      a Saml2UserAuthenticationInputToken
    • setAuthnInputToken

      public void setAuthnInputToken(Saml2UserAuthenticationInputToken authnInputToken)
      Assigns the Saml2UserAuthenticationInputToken for this operation
      Parameters:
      authnInputToken - a Saml2UserAuthenticationInputToken
    • getServletRequest

      public jakarta.servlet.http.HttpServletRequest getServletRequest()
      Gets the servlet request associated with this token.
      Returns:
      the HttpServletRequest or null if not available
    • setServletRequest

      public void setServletRequest(jakarta.servlet.http.HttpServletRequest servletRequest)
      Assigns the servlet request to associate with this token
      Parameters:
      servletRequest - a HttpServletRequest
    • getName

      public String getName()
      Specified by:
      getName in interface Principal
    • getAuthorities

      public Collection<? extends org.springframework.security.core.GrantedAuthority> getAuthorities()
      Specified by:
      getAuthorities in interface org.springframework.security.core.Authentication
    • getCredentials

      public Object getCredentials()
      Specified by:
      getCredentials in interface org.springframework.security.core.Authentication
    • getDetails

      public Object getDetails()
      Specified by:
      getDetails in interface org.springframework.security.core.Authentication
    • getPrincipal

      public Object getPrincipal()
      Specified by:
      getPrincipal in interface org.springframework.security.core.Authentication
    • isAuthenticated

      public boolean isAuthenticated()
      Specified by:
      isAuthenticated in interface org.springframework.security.core.Authentication
    • setAuthenticated

      public void setAuthenticated(boolean isAuthenticated) throws IllegalArgumentException
      Must not be called, will throw IllegalArgumentException.
      Specified by:
      setAuthenticated in interface org.springframework.security.core.Authentication
      Throws:
      IllegalArgumentException