public class OidcTokenV1 extends java.lang.Object implements RestPluginProcess, RestPluginThrottling
GET /oidc/tokenThe frontend calls this endpoint after the callback redirect to obtain tokens for Bearer authentication. Two authentication flows are supported:
Returns HTTP 401 if no valid authentication cookie is present.
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_EXPIRES_IN
Default token expiry in seconds (1 hour).
|
static int |
RATE_LIMIT_PERIOD_SECONDS
Throttling period in seconds (1 minute).
|
static int |
RATE_LIMIT_REQUESTS
Maximum requests per throttling period.
|
| Constructor and Description |
|---|
OidcTokenV1() |
| Modifier and Type | Method and Description |
|---|---|
static JSONObject |
buildErrorResponse()
Builds the JSON error response for unauthenticated requests.
|
static JSONObject |
buildTokenResponse(java.lang.String accessToken,
java.lang.String idToken,
int expiresIn)
Builds the JSON token response returned to the frontend.
|
java.lang.String |
getCounterKey(WebClient client,
RestDefinition restDefinition)
get the key of the throttling counter, the key has to be shorter than 255 characters
|
int |
getPeriod(WebClient client,
RestDefinition rd)
get the throttling period in seconds
|
int |
getRequestLimit(WebClient client,
RestDefinition rd)
-1 is no limit
0 is always reject
n is allow n requests in each throttling period
|
java.lang.Object |
restCreate(WebClient client,
RestDefinition restDefinition,
MutableDataSource mds)
HTTP POST calls the the Create ReST service.
|
java.lang.Object |
restDelete(WebClient client,
RestDefinition restDefinition,
MutableDataSource mds)
HTTP DELETE calls the the Delete ReST service.
|
java.lang.Object |
restRetrieve(WebClient client,
RestDefinition restDefinition,
ReadOnlyDataSource rds)
HTTP GET calls the the Retrieval ReST service.
|
java.lang.Object |
restUpdate(WebClient client,
RestDefinition restDefinition,
MutableDataSource mds)
HTTP PUT calls the the Update ReST service.
|
public static final int DEFAULT_EXPIRES_IN
public static final int RATE_LIMIT_REQUESTS
public static final int RATE_LIMIT_PERIOD_SECONDS
@CheckReturnValue
@Nonnull
public java.lang.Object restRetrieve(@Nonnull
WebClient client,
@Nonnull
RestDefinition restDefinition,
@Nonnull
ReadOnlyDataSource rds)
throws java.lang.Exception
RestPluginProcessrestRetrieve in interface RestPluginProcessclient - the client. Null means check only of opsrestDefinition - the definitionrds - the data source to usejava.lang.UnsupportedOperationException - if this method is NOT supported.java.lang.Exception - an error has occurred.@CheckReturnValue
@Nonnull
public java.lang.Object restCreate(@Nonnull
WebClient client,
@Nonnull
RestDefinition restDefinition,
@Nonnull
MutableDataSource mds)
throws java.lang.Exception
RestPluginProcessrestCreate in interface RestPluginProcessclient - the client. Null means check only of opsrestDefinition - the definitionmds - the data source to usejava.lang.UnsupportedOperationException - if this method is NOT supported.ExceptionResponse - an error has occurred.java.lang.Exception@CheckReturnValue
@Nonnull
public java.lang.Object restUpdate(@Nonnull
WebClient client,
@Nonnull
RestDefinition restDefinition,
@Nonnull
MutableDataSource mds)
throws java.lang.Exception
RestPluginProcessrestUpdate in interface RestPluginProcessclient - the client. Null means check only of opsrestDefinition - the definitionmds - the data source to usejava.lang.UnsupportedOperationException - if this method is NOT supported.ExceptionResponse - an error has occurred.java.lang.Exception@CheckReturnValue
@Nonnull
public java.lang.Object restDelete(@Nonnull
WebClient client,
@Nonnull
RestDefinition restDefinition,
@Nonnull
MutableDataSource mds)
throws java.lang.Exception
RestPluginProcessrestDelete in interface RestPluginProcessclient - the client. Null means check only of opsrestDefinition - the definitionmds - the data source to use.java.lang.UnsupportedOperationException - if this method is NOT supported.ExceptionResponse - an error has occurred.java.lang.Exception@CheckReturnValue
@Nullable
public java.lang.String getCounterKey(@Nonnull
WebClient client,
@Nonnull
RestDefinition restDefinition)
throws java.lang.Exception
RestPluginThrottlinggetCounterKey in interface RestPluginThrottlingclient - the client. Null means check only of opsrestDefinition - the definitionjava.lang.UnsupportedOperationException - if this method is NOT supported.java.lang.Exception - an error has occurred.public int getRequestLimit(@Nonnull
WebClient client,
@Nonnull
RestDefinition rd)
throws java.lang.Exception
RestPluginThrottlinggetRequestLimit in interface RestPluginThrottlingclient - the client. Null means check only of opsrd - the definitionjava.lang.UnsupportedOperationException - use default throttling settings configured in RestDefinition recordjava.lang.Exceptionpublic int getPeriod(@Nonnull
WebClient client,
@Nonnull
RestDefinition rd)
throws java.lang.Exception
RestPluginThrottlinggetPeriod in interface RestPluginThrottlingclient - the client. Null means check only of opsrd - the definitionjava.lang.UnsupportedOperationException - use default throttling settings configured in RestDefinition recordjava.lang.Exception@CheckReturnValue @Nonnull public static JSONObject buildTokenResponse(@Nonnull java.lang.String accessToken, @Nonnull java.lang.String idToken, int expiresIn)
accessToken - the OAuth2 access tokenidToken - the OpenID Connect ID tokenexpiresIn - the token lifetime in seconds@CheckReturnValue @Nonnull public static JSONObject buildErrorResponse()
stSoftware Copyright © 2001-2014 stSoftware All Rights Reserved.