Class RecoveryCodesSuccessHandler

java.lang.Object
com.irurueta.authserver.authorization.api.web.totp.RecoveryCodesSuccessHandler
All Implemented Interfaces:
org.springframework.security.web.authentication.AuthenticationSuccessHandler

public class RecoveryCodesSuccessHandler extends Object implements org.springframework.security.web.authentication.AuthenticationSuccessHandler
Success handler of the second-factor post: when the post confirmed an enrolment and recovery codes are waiting to be shown, the browser goes to the page that shows them once (whose "Continue" button resumes the interrupted request); otherwise the delegate resumes the interrupted request straight away.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final org.springframework.security.web.authentication.AuthenticationSuccessHandler
    Handler that resumes the interrupted request.
    private final PendingRecoveryCodes
    Keeps the codes waiting to be shown.
    private final org.springframework.security.web.RedirectStrategy
    Strategy that redirects, honouring the context path.
  • 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)
    Redirects to the recovery codes page or resumes the interrupted request.

    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

    • redirectStrategy

      private final org.springframework.security.web.RedirectStrategy redirectStrategy
      Strategy that redirects, honouring the context path.
    • pendingRecoveryCodes

      private final PendingRecoveryCodes pendingRecoveryCodes
      Keeps the codes waiting to be shown.
    • delegate

      private final org.springframework.security.web.authentication.AuthenticationSuccessHandler delegate
      Handler that resumes the interrupted request.
  • Constructor Details

    • RecoveryCodesSuccessHandler

      public RecoveryCodesSuccessHandler()
  • 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
      Redirects to the recovery codes page or resumes the interrupted request.
      Specified by:
      onAuthenticationSuccess in interface org.springframework.security.web.authentication.AuthenticationSuccessHandler
      Parameters:
      request - the request.
      response - the response.
      authentication - the verified authentication.
      Throws:
      IOException - if the redirect cannot be sent.
      jakarta.servlet.ServletException - if the delegate fails.