Class ClientCredentialsTokenSource.Builder
java.lang.Object
com.revetsec.oauth.ClientCredentialsTokenSource.Builder
- Enclosing class:
ClientCredentialsTokenSource
@NotThreadSafe
@CheckReturnValue
public static final class ClientCredentialsTokenSource.Builder
extends Object
Configures a source without network I/O.
- Since:
- 1.0.0
- Author:
- Mark Allen
-
Method Summary
Modifier and TypeMethodDescriptionReplaces provider-specific nonreserved token form parameters.build()Builds the source without I/O, secret/key-provider callbacks or a worker thread.Sets the fallback cache lifetime when expires_in is absent.Sets the maximum cache lifetime.renewBefore(@Nullable Duration value) Sets the renewal lead time, clipped to half the actual lifetime.Replaces the complete resource list.Replaces the complete scope set; null uses the client's default.
-
Method Details
-
scopes
-
resources
-
additionalParameters
public @NonNull ClientCredentialsTokenSource.Builder additionalParameters(@Nullable Map<@NonNull String, @NonNull String> value) Replaces provider-specific nonreserved token form parameters.- Parameters:
value- parameters, or null to clear them- Returns:
- this builder
- Since:
- 1.0.0
-
fallbackCacheDuration
public @NonNull ClientCredentialsTokenSource.Builder fallbackCacheDuration(@Nullable Duration value) Sets the fallback cache lifetime when expires_in is absent.- Parameters:
value- fallback duration, or null which restores the default- Returns:
- this builder
- Since:
- 1.0.0
-
maximumCacheDuration
Sets the maximum cache lifetime.- Parameters:
value- maximum duration, or null which restores the default- Returns:
- this builder
- Since:
- 1.0.0
-
renewBefore
Sets the renewal lead time, clipped to half the actual lifetime.- Parameters:
value- lead time, or null which restores the default- Returns:
- this builder
- Since:
- 1.0.0
-
build
Builds the source without I/O, secret/key-provider callbacks or a worker thread. Rejects public-client authentication locally; provider capability and endpoint checks occur when requesting.- Returns:
- the source
- Throws:
IllegalArgumentException- if the client has no confidential authentication strategy- Since:
- 1.0.0
-