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:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.security.core.Authentication
org.springframework.security.core.Authentication.Builder<B extends org.springframework.security.core.Authentication.Builder<B>> -
Constructor Summary
ConstructorsConstructorDescriptionResumedAuthenticationToken(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 theSaml2UserAuthenticationInputTokenfor this operation.org.springframework.security.core.AuthenticationGets 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.HttpServletRequestGets the servlet request associated with this token.booleanvoidsetAuthenticated(boolean isAuthenticated) Must not be called, will throwIllegalArgumentException.voidsetAuthnInputToken(Saml2UserAuthenticationInputToken authnInputToken) Assigns theSaml2UserAuthenticationInputTokenfor this operationvoidsetServletRequest(jakarta.servlet.http.HttpServletRequest servletRequest) Assigns the servlet request to associate with this tokenMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.security.core.Authentication
toBuilder
-
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
Authenticationobject ornullif this object represents an authentication error
-
getError
If this authentication object represents an authentication error the method returns this error.- Returns:
- a
Saml2ErrorStatusExceptionornullif this object represents a successful authentication
-
getAuthnInputToken
Gets theSaml2UserAuthenticationInputTokenfor this operation.- Returns:
- a
Saml2UserAuthenticationInputToken
-
setAuthnInputToken
Assigns theSaml2UserAuthenticationInputTokenfor this operation- Parameters:
authnInputToken- aSaml2UserAuthenticationInputToken
-
getServletRequest
public jakarta.servlet.http.HttpServletRequest getServletRequest()Gets the servlet request associated with this token.- Returns:
- the
HttpServletRequestornullif 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:
getAuthoritiesin interfaceorg.springframework.security.core.Authentication
-
getCredentials
- Specified by:
getCredentialsin interfaceorg.springframework.security.core.Authentication
-
getDetails
- Specified by:
getDetailsin interfaceorg.springframework.security.core.Authentication
-
getPrincipal
- Specified by:
getPrincipalin interfaceorg.springframework.security.core.Authentication
-
isAuthenticated
public boolean isAuthenticated()- Specified by:
isAuthenticatedin interfaceorg.springframework.security.core.Authentication
-
setAuthenticated
Must not be called, will throwIllegalArgumentException.- Specified by:
setAuthenticatedin interfaceorg.springframework.security.core.Authentication- Throws:
IllegalArgumentException
-