public class OAuth2WebClientOptions extends Object
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_LEEWAY
The default leeway when validating token expiration times.
|
static boolean |
DEFAULT_RENEW_TOKEN_ON_FORBIDDEN
The default value of whether to perform a single token refresh if the response status code is 401 (Forbidden).
|
Constructor and Description |
---|
OAuth2WebClientOptions() |
OAuth2WebClientOptions(JsonObject json)
Creates a new instance from JSON.
|
OAuth2WebClientOptions(OAuth2WebClientOptions other)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
getLeeway()
Weather to allow leeway while validating if a token is considered expired.
|
boolean |
isRenewTokenOnForbidden()
Weather to refresh or not the current user token if a forbidden http status response is received.
|
OAuth2WebClientOptions |
setLeeway(int leeway)
Set a default leeway in seconds to be considered while validating tokens for expiration.
|
OAuth2WebClientOptions |
setRenewTokenOnForbidden(boolean renewTokenOnForbidden)
Set a default behavior on how to handle the first forbidden response.
|
JsonObject |
toJson()
Convert to JSON
|
public static final boolean DEFAULT_RENEW_TOKEN_ON_FORBIDDEN
public static final int DEFAULT_LEEWAY
public OAuth2WebClientOptions()
public OAuth2WebClientOptions(OAuth2WebClientOptions other)
other
- the options to copypublic OAuth2WebClientOptions(JsonObject json)
json
- the JSON objectpublic JsonObject toJson()
public boolean isRenewTokenOnForbidden()
DEFAULT_RENEW_TOKEN_ON_FORBIDDEN
public OAuth2WebClientOptions setRenewTokenOnForbidden(boolean renewTokenOnForbidden)
true
to attempt a token refresh and
replay the request. false
to continue the request to the user handler/promise.renewTokenOnForbidden
- the desired intention.public int getLeeway()
DEFAULT_LEEWAY
public OAuth2WebClientOptions setLeeway(int leeway)
leeway
- the desired leeway in secondsCopyright © 2024 Eclipse. All rights reserved.