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

    Fields
    Modifier and Type
    Field
    Description
    private final org.springframework.security.web.authentication.AuthenticationSuccessHandler
    Resumes the interrupted request.
    private final FactorGrantor
    Adds the factor authority.
    private final org.springframework.security.core.context.SecurityContextHolderStrategy
    Holder of the security context of the thread.
    private final org.springframework.security.web.context.SecurityContextRepository
    Saves the security context, in the request and in the session.
    private org.springframework.security.web.authentication.session.SessionAuthenticationStrategy
    Strategy that changes the session id and renews the CSRF token, set once the chain is built.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    onAuthenticationSuccess(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, wait

    Methods inherited from interface org.springframework.security.web.authentication.AuthenticationSuccessHandler

    onAuthenticationSuccess
  • Field Details

    • factorGrantor

      private final FactorGrantor factorGrantor
      Adds the factor authority.
    • securityContextRepository

      private final org.springframework.security.web.context.SecurityContextRepository securityContextRepository
      Saves the security context, in the request and in the session.
    • delegate

      private final org.springframework.security.web.authentication.AuthenticationSuccessHandler delegate
      Resumes the interrupted request.
    • holderStrategy

      private final org.springframework.security.core.context.SecurityContextHolderStrategy holderStrategy
      Holder of the security context of the thread.
    • sessionAuthenticationStrategy

      private org.springframework.security.web.authentication.session.SessionAuthenticationStrategy sessionAuthenticationStrategy
      Strategy 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:
      onAuthenticationSuccess in interface org.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.