Class X509AuthenticationSuccessHandler
java.lang.Object
com.irurueta.authserver.authorization.api.web.x509.X509AuthenticationSuccessHandler
- All Implemented Interfaces:
org.springframework.security.web.authentication.AuthenticationSuccessHandler
public class X509AuthenticationSuccessHandler
extends Object
implements org.springframework.security.web.authentication.AuthenticationSuccessHandler
Completes a sign-in with a client certificate. The framework's authentication is a
PreAuthenticatedAuthenticationToken, which the stored authorizations cannot serialize and whose factor
authority is a plain one; this handler replaces it by the ordinary authentication of the account, with the
authorities the account and the session already had and the certificate factor stamped with the clock (which is what
auth_time and max_age are measured with), changes the session id and renews the CSRF token as the
other sign-in methods do, saves the security context and resumes the interrupted request.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.springframework.security.web.authentication.AuthenticationSuccessHandlerResumes the interrupted request.private final FactorGrantorAdds the factor authority.private final org.springframework.security.core.context.SecurityContextHolderStrategyHolder of the security context of the thread.private final org.springframework.security.web.context.SecurityContextRepositorySaves the security context, in the request and in the session.private org.springframework.security.web.authentication.session.SessionAuthenticationStrategyStrategy that changes the session id and renews the CSRF token, set once the chain is built. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidonAuthenticationSuccess(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.security.core.Authentication authentication) Replaces the authentication, grants the factor and continues.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.security.web.authentication.AuthenticationSuccessHandler
onAuthenticationSuccess
-
Field Details
-
factorGrantor
Adds the factor authority. -
securityContextRepository
private final org.springframework.security.web.context.SecurityContextRepository securityContextRepositorySaves the security context, in the request and in the session. -
delegate
private final org.springframework.security.web.authentication.AuthenticationSuccessHandler delegateResumes the interrupted request. -
holderStrategy
private final org.springframework.security.core.context.SecurityContextHolderStrategy holderStrategyHolder of the security context of the thread. -
sessionAuthenticationStrategy
private org.springframework.security.web.authentication.session.SessionAuthenticationStrategy sessionAuthenticationStrategyStrategy that changes the session id and renews the CSRF token, set once the chain is built.
-
-
Constructor Details
-
X509AuthenticationSuccessHandler
public X509AuthenticationSuccessHandler()
-
-
Method Details
-
onAuthenticationSuccess
public void onAuthenticationSuccess(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.security.core.Authentication authentication) throws IOException, jakarta.servlet.ServletException Replaces the authentication, grants the factor and continues.- Specified by:
onAuthenticationSuccessin interfaceorg.springframework.security.web.authentication.AuthenticationSuccessHandler- Parameters:
request- the request.response- the response.authentication- the authentication the framework produced.- Throws:
IOException- if the redirect fails.jakarta.servlet.ServletException- if the redirect fails.
-