Class OAuth2WebClientOptions
java.lang.Object
io.vertx.ext.web.client.OAuth2WebClientOptions
- Author:
- Paulo Lopes
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe default leeway when validating token expiration times.static final booleanThe default value of whether to perform a single token refresh if the response status code is 401 (Forbidden). -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance from JSON.Copy constructor. -
Method Summary
Modifier and TypeMethodDescriptionintWeather to allow leeway while validating if a token is considered expired.booleanWeather to refresh or not the current user token if a forbidden http status response is received.setLeeway(int leeway) Set a default leeway in seconds to be considered while validating tokens for expiration.setRenewTokenOnForbidden(boolean renewTokenOnForbidden) Set a default behavior on how to handle the first forbidden response.toJson()Convert to JSON
-
Field Details
-
DEFAULT_RENEW_TOKEN_ON_FORBIDDEN
public static final boolean DEFAULT_RENEW_TOKEN_ON_FORBIDDENThe default value of whether to perform a single token refresh if the response status code is 401 (Forbidden).- See Also:
-
DEFAULT_LEEWAY
public static final int DEFAULT_LEEWAYThe default leeway when validating token expiration times.- See Also:
-
-
Constructor Details
-
OAuth2WebClientOptions
public OAuth2WebClientOptions() -
OAuth2WebClientOptions
Copy constructor.- Parameters:
other- the options to copy
-
OAuth2WebClientOptions
Creates a new instance from JSON.- Parameters:
json- the JSON object
-
-
Method Details
-
toJson
-
isRenewTokenOnForbidden
public boolean isRenewTokenOnForbidden()Weather to refresh or not the current user token if a forbidden http status response is received.- Returns:
- default value is
DEFAULT_RENEW_TOKEN_ON_FORBIDDEN
-
setRenewTokenOnForbidden
Set a default behavior on how to handle the first forbidden response.trueto attempt a token refresh and replay the request.falseto continue the request to the user handler/promise.- Parameters:
renewTokenOnForbidden- the desired intention.- Returns:
- fluent self
-
getLeeway
public int getLeeway()Weather to allow leeway while validating if a token is considered expired.- Returns:
- default value is
DEFAULT_LEEWAY
-
setLeeway
Set a default leeway in seconds to be considered while validating tokens for expiration.- Parameters:
leeway- the desired leeway in seconds- Returns:
- fluent self
-