Class RecoveryCodesPageController

java.lang.Object
com.irurueta.authserver.authorization.api.web.totp.RecoveryCodesPageController
All Implemented Interfaces:
RecoveryCodesPageApi

@Controller public class RecoveryCodesPageController extends Object implements RecoveryCodesPageApi
Serves the page that shows, once, the recovery codes generated when an authenticator app was enrolled during the sign-in, as the contract apis/auth-server/web-pages/auth-server-pages-v1.yaml describes it through the generated RecoveryCodesPageApi. The codes are taken out of the session as the page is rendered, so a reload shows none; its "Continue" button resumes the request the sign-in interrupted (kept by the session request cache), or goes to the root when there is none.
  • Field Details

    • RECOVERY_CODES_PATH

      public static final String RECOVERY_CODES_PATH
      Path of the page, taken from the contract.
      See Also:
    • VIEW_NAME

      static final String VIEW_NAME
      Name of the template.
      See Also:
    • CODES_ATTRIBUTE

      static final String CODES_ATTRIBUTE
      Name of the model attribute that holds the codes.
      See Also:
    • CONTINUE_ATTRIBUTE

      static final String CONTINUE_ATTRIBUTE
      Name of the model attribute that holds where the "Continue" button goes.
      See Also:
    • DEFAULT_CONTINUE_URL

      static final String DEFAULT_CONTINUE_URL
      Where the "Continue" button goes when no request is waiting to be resumed.
      See Also:
    • requestCache

      private final org.springframework.security.web.savedrequest.RequestCache requestCache
      Cache that keeps the interrupted request, shared with the form login and the second-factor entry point.
    • pendingRecoveryCodes

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

      private final PageRenderer pageRenderer
      Renders the page.
    • request

      private final jakarta.servlet.http.HttpServletRequest request
      The current request, injected as a thread-bound proxy.
    • response

      private final jakarta.servlet.http.HttpServletResponse response
      The current response, injected as a thread-bound proxy.
  • Constructor Details

    • RecoveryCodesPageController

      public RecoveryCodesPageController()
  • Method Details

    • recoveryCodesPage

      public org.springframework.http.ResponseEntity<String> recoveryCodesPage()
      Renders the page and forgets the codes.
      Specified by:
      recoveryCodesPage in interface RecoveryCodesPageApi
      Returns:
      the recovery codes page.