Class IssueTokenContextHolder
- java.lang.Object
-
- jetbrains.buildServer.serverSide.oauth.IssueTokenContextHolder
-
public class IssueTokenContextHolder extends Object
-
-
Constructor Summary
Constructors Constructor Description IssueTokenContextHolder()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
consumeIssuedTokenId(javax.servlet.http.HttpServletRequest request, String newTokenRequestId)
Retrieves and consumes the stored issued token ID from the user's HTTP session using the given token request ID.static IssueTokenParameters
consumeParameters(javax.servlet.http.HttpServletRequest request, String id)
Retrieves and consumes the stored parameters from the user's HTTP session using the given ID.static void
rememberIssuedTokenId(javax.servlet.http.HttpServletRequest request, String newTokenRequestId, String tokenId)
Stores the issued token ID in the user's session using the provided token request ID.static String
rememberParameters(javax.servlet.http.HttpServletRequest request, IssueTokenParameters parameters)
Stores the given parameters into the user's HTTP session for later retrieval.
-
-
-
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 requestparameters
- 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 requestid
- 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 requestnewTokenRequestId
- the ID of the original request to issue a new tokentokenId
- 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 requestnewTokenRequestId
- the ID of the original request to issue a new token- Returns:
- the stored issued token ID, or null if not found
-
-