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 Summary
ConstructorDescriptionResumedAuthenticationToken
(org.springframework.security.core.Authentication authnToken) Constructor setting up the token to represent a successful authenticationConstructor setting up the token to represent an authentication error. -
Method Summary
Modifier and TypeMethodDescriptionGets theSaml2UserAuthenticationInputToken
for this operation.org.springframework.security.core.Authentication
Gets the authentication token the represents the user authentication (from the external process).Collection
<? extends org.springframework.security.core.GrantedAuthority> getError()
If this authentication object represents an authentication error the method returns this error.getName()
jakarta.servlet.http.HttpServletRequest
Gets the servlet request associated with this token.boolean
void
setAuthenticated
(boolean isAuthenticated) Must not be called, will throwIllegalArgumentException
.void
setAuthnInputToken
(Saml2UserAuthenticationInputToken authnInputToken) Assigns theSaml2UserAuthenticationInputToken
for this operationvoid
setServletRequest
(jakarta.servlet.http.HttpServletRequest servletRequest) Assigns the servlet request to associate with this token
-
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
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 ornull
if this object represents an authentication error
-
getError
If this authentication object represents an authentication error the method returns this error.- Returns:
- a
Saml2ErrorStatusException
ornull
if this object represents a successful authentication
-
getAuthnInputToken
Gets theSaml2UserAuthenticationInputToken
for this operation.- Returns:
- a
Saml2UserAuthenticationInputToken
-
setAuthnInputToken
Assigns theSaml2UserAuthenticationInputToken
for this operation- Parameters:
authnInputToken
- aSaml2UserAuthenticationInputToken
-
getServletRequest
public jakarta.servlet.http.HttpServletRequest getServletRequest()Gets the servlet request associated with this token.- Returns:
- the
HttpServletRequest
ornull
if not available
-
setServletRequest
public void setServletRequest(jakarta.servlet.http.HttpServletRequest servletRequest) Assigns the servlet request to associate with this token- Parameters:
servletRequest
- aHttpServletRequest
-
getName
-
getAuthorities
- Specified by:
getAuthorities
in interfaceorg.springframework.security.core.Authentication
-
getCredentials
- Specified by:
getCredentials
in interfaceorg.springframework.security.core.Authentication
-
getDetails
- Specified by:
getDetails
in interfaceorg.springframework.security.core.Authentication
-
getPrincipal
- Specified by:
getPrincipal
in interfaceorg.springframework.security.core.Authentication
-
isAuthenticated
public boolean isAuthenticated()- Specified by:
isAuthenticated
in interfaceorg.springframework.security.core.Authentication
-
setAuthenticated
Must not be called, will throwIllegalArgumentException
.- Specified by:
setAuthenticated
in interfaceorg.springframework.security.core.Authentication
- Throws:
IllegalArgumentException
-