Class Saml2UserAuthenticationInputToken
java.lang.Object
org.springframework.security.authentication.AbstractAuthenticationToken
se.swedenconnect.spring.saml.idp.authentication.Saml2UserAuthenticationInputToken
- All Implemented Interfaces:
Serializable
,Principal
,org.springframework.security.core.Authentication
,org.springframework.security.core.CredentialsContainer
public class Saml2UserAuthenticationInputToken
extends org.springframework.security.authentication.AbstractAuthenticationToken
An
Authentication
class that represents the input to a user authentication process for a SAML IdP.- Author:
- Martin Lindström
- See Also:
-
Constructor Summary
ConstructorDescriptionSaml2UserAuthenticationInputToken
(Saml2AuthnRequestAuthenticationToken authnRequestToken, AuthenticationRequirements authnRequirements) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionGets the authentication request token.Gets the authentication requirements.Gets the UI info - may be useful for IdP UI.org.springframework.security.core.Authentication
If anAuthentication
object is available (from theSecurityContextHolder
) when entering the SAML flow, this object is made available to the authentication process that will determine if this authentication object may be used for SSO.void
setUserAuthentication
(org.springframework.security.core.Authentication userAuthentication) Assigns the userAuthentication
object from a previous authentication process.Methods inherited from class org.springframework.security.authentication.AbstractAuthenticationToken
equals, eraseCredentials, getAuthorities, getDetails, getName, hashCode, isAuthenticated, setAuthenticated, setDetails, toString
-
Constructor Details
-
Saml2UserAuthenticationInputToken
public Saml2UserAuthenticationInputToken(Saml2AuthnRequestAuthenticationToken authnRequestToken, AuthenticationRequirements authnRequirements) Constructor.- Parameters:
authnRequestToken
- the authentication request tokenauthnRequirements
- the authentication requirements
-
-
Method Details
-
getAuthnRequestToken
Gets the authentication request token.- Returns:
- the authentication request token
-
getAuthnRequirements
Gets the authentication requirements.- Returns:
- the authentication requirements
-
getUserAuthentication
public org.springframework.security.core.Authentication getUserAuthentication()If anAuthentication
object is available (from theSecurityContextHolder
) when entering the SAML flow, this object is made available to the authentication process that will determine if this authentication object may be used for SSO.- Returns:
- the
Authentication
object from a previous authentication, ornull
if not available
-
setUserAuthentication
public void setUserAuthentication(org.springframework.security.core.Authentication userAuthentication) Assigns the userAuthentication
object from a previous authentication process.- Parameters:
userAuthentication
- anAuthentication
object
-
getCredentials
-
getPrincipal
-
getUiInfo
Gets the UI info - may be useful for IdP UI.- Returns:
- a
Saml2ServiceProviderUiInfo
-
getLogString
- Returns:
- a formatted log string
-