Class Saml2AssertionAuthentication
java.lang.Object
org.springframework.security.authentication.AbstractAuthenticationToken
org.springframework.security.saml2.provider.service.authentication.Saml2Authentication
org.springframework.security.saml2.provider.service.authentication.Saml2AssertionAuthentication
- All Implemented Interfaces:
Serializable,Principal,Authentication,CredentialsContainer
An authentication based off of a SAML 2.0 Assertion
- Since:
- 7.0
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA builder ofSaml2AssertionAuthenticationinstancesNested classes/interfaces inherited from class org.springframework.security.authentication.AbstractAuthenticationToken
AbstractAuthenticationToken.AbstractAuthenticationBuilder<B extends AbstractAuthenticationToken.AbstractAuthenticationBuilder<B>> -
Constructor Summary
ConstructorsModifierConstructorDescriptionSaml2AssertionAuthentication(Object principal, Saml2ResponseAssertionAccessor assertion, Collection<? extends GrantedAuthority> authorities, String relyingPartyRegistrationId) protectedSaml2AssertionAuthentication(Saml2ResponseAssertionAccessor assertion, Collection<? extends GrantedAuthority> authorities, String relyingPartyRegistrationId) -
Method Summary
Modifier and TypeMethodDescriptionThe credentials that prove the principal is correct.Return anAuthentication.Builderbased on this instance.Methods inherited from class org.springframework.security.saml2.provider.service.authentication.Saml2Authentication
getPrincipal, getSaml2ResponseMethods inherited from class org.springframework.security.authentication.AbstractAuthenticationToken
equals, eraseCredentials, getAuthorities, getDetails, getName, hashCode, isAuthenticated, setAuthenticated, setDetails, toString
-
Constructor Details
-
Saml2AssertionAuthentication
public Saml2AssertionAuthentication(Saml2ResponseAssertionAccessor assertion, Collection<? extends GrantedAuthority> authorities, String relyingPartyRegistrationId) -
Saml2AssertionAuthentication
public Saml2AssertionAuthentication(Object principal, Saml2ResponseAssertionAccessor assertion, Collection<? extends GrantedAuthority> authorities, String relyingPartyRegistrationId) -
Saml2AssertionAuthentication
-
-
Method Details
-
getCredentials
Description copied from interface:AuthenticationThe credentials that prove the principal is correct. This is usually a password, but could be anything relevant to theAuthenticationManager. Callers are expected to populate the credentials.- Specified by:
getCredentialsin interfaceAuthentication- Overrides:
getCredentialsin classSaml2Authentication- Returns:
- the credentials that prove the identity of the
Principal
-
getRelyingPartyRegistrationId
-
toBuilder
Description copied from interface:AuthenticationReturn anAuthentication.Builderbased on this instance. By default, returns a builder that builds aSimpleAuthentication.Although a
defaultmethod, allAuthenticationimplementations should implement this. The reason is to ensure that theAuthenticationtype is preserved whenAuthentication.Builder.build()is invoked. This is especially important in the event that your authentication implementation contains custom fields.This isn't strictly necessary since it is recommended that applications code to the
Authenticationinterface and that custom information is often contained in theAuthentication.getPrincipal()value.- Returns:
- an
Authentication.Builderfor building a newAuthenticationbased on this instance
-