Class IssueTokenContextHolder


  • public class IssueTokenContextHolder
    extends Object
    • Constructor Detail

      • IssueTokenContextHolder

        public IssueTokenContextHolder()
    • Method Detail

      • rememberParameters

        @NotNull
        public static String rememberParameters​(@NotNull
                                                javax.servlet.http.HttpServletRequest request,
                                                @NotNull
                                                IssueTokenParameters parameters)
        Stores the given parameters into the user's HTTP session for later retrieval. A unique ID will be generated to be used in the retrieval.
        Parameters:
        request - HTTP servlet request
        parameters - parameters to store
        Returns:
        unique ID
      • consumeParameters

        @NotNull
        public static IssueTokenParameters consumeParameters​(@NotNull
                                                             javax.servlet.http.HttpServletRequest request,
                                                             @NotNull
                                                             String id)
        Retrieves and consumes the stored parameters from the user's HTTP session using the given ID.
        Parameters:
        request - HTTP servlet request
        id - unique ID of the stored parameters
        Returns:
        parameters
      • rememberIssuedTokenId

        public static void rememberIssuedTokenId​(@NotNull
                                                 javax.servlet.http.HttpServletRequest request,
                                                 @NotNull
                                                 String newTokenRequestId,
                                                 @NotNull
                                                 String tokenId)
        Stores the issued token ID in the user's session using the provided token request ID.
        Parameters:
        request - the HTTP servlet request
        newTokenRequestId - the ID of the original request to issue a new token
        tokenId - the full ID of the issued token
      • consumeIssuedTokenId

        @Nullable
        public static String consumeIssuedTokenId​(@NotNull
                                                  javax.servlet.http.HttpServletRequest request,
                                                  @NotNull
                                                  String newTokenRequestId)
        Retrieves and consumes the stored issued token ID from the user's HTTP session using the given token request ID. If the stored token ID is found, it is removed from the session and returned.
        Parameters:
        request - the HTTP servlet request
        newTokenRequestId - the ID of the original request to issue a new token
        Returns:
        the stored issued token ID, or null if not found