Class CachingClientCredentialsFlow.Builder
java.lang.Object
org.apache.juneau.rest.server.auth.oauth.CachingClientCredentialsFlow.Builder
- Enclosing class:
- CachingClientCredentialsFlow
Builder.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the flow.Sets the skew tolerance subtracted from the cached token's expiry.Sets the OAuth client ID.clientSecret(String value) Sets the OAuth client secret as a literal string.clientSecretSupplier(Supplier<String> value) Sets the OAuth client secret via a supplier.httpRequestConfigurator(Consumer<com.nimbusds.oauth2.sdk.http.HTTPRequest> value) Sets a callback that customizes the NimbusHTTPRequest.Adds requested OAuth scopes.tokenCache(TokenCache value) Configures the cache for the acquired token.tokenEndpoint(URI value) Sets the token endpoint URL.
-
Constructor Details
-
Builder
protected Builder()Constructor.
-
-
Method Details
-
tokenEndpoint
Sets the token endpoint URL. Required.- Parameters:
value- The endpoint URL. Must not benull .- Returns:
- This object.
-
clientId
Sets the OAuth client ID. Required.- Parameters:
value- The client ID. Must not benull or blank.- Returns:
- This object.
-
clientSecret
Sets the OAuth client secret as a literal string.- Parameters:
value- The client secret. Must not benull or blank.- Returns:
- This object.
-
clientSecretSupplier
Sets the OAuth client secret via a supplier.- Parameters:
value- The supplier. Must not benull .- Returns:
- This object.
-
scope
Adds requested OAuth scopes.- Parameters:
values- The scopes.- Returns:
- This object.
-
tokenCache
Configures the cache for the acquired token.- Parameters:
value- The cache. Must not benull .- Returns:
- This object.
-
cacheSkew
Sets the skew tolerance subtracted from the cached token's expiry. Default 30s.- Parameters:
value- The skew. Must be non-negative.- Returns:
- This object.
-
httpRequestConfigurator
public CachingClientCredentialsFlow.Builder httpRequestConfigurator(Consumer<com.nimbusds.oauth2.sdk.http.HTTPRequest> value) Sets a callback that customizes the NimbusHTTPRequest.- Parameters:
value- The callback. Must not benull .- Returns:
- This object.
-
build
Builds the flow.- Returns:
- A new
CachingClientCredentialsFlow.
-