java.lang.Object
org.springframework.security.authentication.AbstractAuthenticationToken
org.springframework.security.saml2.provider.service.authentication.Saml2AuthenticationToken
All Implemented Interfaces:
Serializable, Principal, org.springframework.security.core.Authentication, org.springframework.security.core.CredentialsContainer

public class Saml2AuthenticationToken extends org.springframework.security.authentication.AbstractAuthenticationToken
Represents an incoming SAML 2.0 response containing an assertion that has not been validated. isAuthenticated() will always return false.
Since:
5.2
See Also:
  • Constructor Details

  • Method Details

    • getCredentials

      public Object getCredentials()
      Returns the decoded and inflated SAML 2.0 Response XML object as a string
      Returns:
      decoded and inflated XML data as a String
    • getPrincipal

      public Object getPrincipal()
      Always returns null.
      Returns:
      null
    • getRelyingPartyRegistration

      public RelyingPartyRegistration getRelyingPartyRegistration()
      Get the resolved RelyingPartyRegistration associated with the request
      Returns:
      the resolved RelyingPartyRegistration
      Since:
      5.4
    • getSaml2Response

      public String getSaml2Response()
      Returns inflated and decoded XML representation of the SAML 2 Response
      Returns:
      inflated and decoded XML representation of the SAML 2 Response
    • isAuthenticated

      public boolean isAuthenticated()
      Specified by:
      isAuthenticated in interface org.springframework.security.core.Authentication
      Overrides:
      isAuthenticated in class org.springframework.security.authentication.AbstractAuthenticationToken
      Returns:
      false
    • setAuthenticated

      public void setAuthenticated(boolean authenticated)
      The state of this object cannot be changed. Will always throw an exception
      Specified by:
      setAuthenticated in interface org.springframework.security.core.Authentication
      Overrides:
      setAuthenticated in class org.springframework.security.authentication.AbstractAuthenticationToken
      Parameters:
      authenticated - ignored
    • getAuthenticationRequest

      public AbstractSaml2AuthenticationRequest getAuthenticationRequest()
      Returns the authentication request sent to the assertion party or null if no authentication request is present
      Returns:
      the authentication request sent to the assertion party
      Since:
      5.6