Class PendingRecoveryCodes

java.lang.Object
com.irurueta.authserver.authorization.api.web.totp.PendingRecoveryCodes

@Component public class PendingRecoveryCodes extends Object
Keeps, in the session, the recovery codes generated when an authenticator app is enrolled during the sign-in, from the post that confirms it until the page that shows them once (RecoveryCodesPageController), which takes them out of the session.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) static final String
    Name of the session attribute that holds the codes.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    isPending(jakarta.servlet.http.HttpServletRequest request)
    Tells whether the session of a request holds codes not shown yet.
    void
    save(jakarta.servlet.http.HttpServletRequest request, List<String> codes)
    Stores the codes in the session of a request.
    take(jakarta.servlet.http.HttpServletRequest request)
    Takes the codes out of the session of a request, so they are shown only once.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • ATTRIBUTE

      static final String ATTRIBUTE
      Name of the session attribute that holds the codes.
  • Constructor Details

    • PendingRecoveryCodes

      public PendingRecoveryCodes()
  • Method Details

    • save

      public void save(jakarta.servlet.http.HttpServletRequest request, List<String> codes)
      Stores the codes in the session of a request.
      Parameters:
      request - the request.
      codes - the codes in clear text.
    • isPending

      public boolean isPending(jakarta.servlet.http.HttpServletRequest request)
      Tells whether the session of a request holds codes not shown yet.
      Parameters:
      request - the request.
      Returns:
      true when there are codes waiting to be shown.
    • take

      public List<String> take(jakarta.servlet.http.HttpServletRequest request)
      Takes the codes out of the session of a request, so they are shown only once.
      Parameters:
      request - the request.
      Returns:
      the codes; empty when there are none.