Class OAuth2ClientCredentialsProvider.Builder
java.lang.Object
org.cibseven.bpm.client.interceptor.auth.OAuth2ClientCredentialsProvider.Builder
- Enclosing class:
- OAuth2ClientCredentialsProvider
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadditionalParameter(String key, String value) Adds a custom parameter to the token request (optional).additionalParameters(Map<String, String> additionalParameters) Sets all custom parameters for the token request (optional).Sets the OAuth2 audience parameter (optional).build()clientAssertionProvider(ClientAssertionProvider clientAssertionProvider) Sets aClientAssertionProviderfor JWT Bearer client authentication.Sets the OAuth2 client ID (required).clientSecret(String clientSecret) Sets the client secret forclient_secret_postauthentication.expiryBuffer(Duration expiryBuffer) Sets how long before token expiry a refresh should be triggered (default: 30 seconds).httpClient(org.apache.hc.client5.http.impl.classic.CloseableHttpClient httpClient) Sets a customCloseableHttpClientfor token requests (optional).objectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper) Sets a customObjectMapperfor parsing token responses (optional).Sets the OAuth2 resource parameter (optional).Sets the OAuth2 scope(s) to request (optional).Sets the OAuth2 token endpoint URI (required).
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
tokenUri
Sets the OAuth2 token endpoint URI (required). -
clientId
Sets the OAuth2 client ID (required). -
clientSecret
Sets the client secret forclient_secret_postauthentication. Mutually exclusive withclientAssertionProvider(ClientAssertionProvider). -
clientAssertionProvider
public OAuth2ClientCredentialsProvider.Builder clientAssertionProvider(ClientAssertionProvider clientAssertionProvider) Sets aClientAssertionProviderfor JWT Bearer client authentication. Mutually exclusive withclientSecret(String). -
scope
Sets the OAuth2 scope(s) to request (optional). Usenullor omit to request without a scope parameter. -
audience
Sets the OAuth2 audience parameter (optional). Used by Auth0, some Keycloak configurations, and other IdPs. -
resource
Sets the OAuth2 resource parameter (optional). Used by Azure AD v1 endpoints and some other IdPs. -
additionalParameter
Adds a custom parameter to the token request (optional). Use this for IdP-specific parameters not covered by dedicated builder methods. -
additionalParameters
public OAuth2ClientCredentialsProvider.Builder additionalParameters(Map<String, String> additionalParameters) Sets all custom parameters for the token request (optional). Replaces any previously added additional parameters. -
expiryBuffer
Sets how long before token expiry a refresh should be triggered (default: 30 seconds). -
httpClient
public OAuth2ClientCredentialsProvider.Builder httpClient(org.apache.hc.client5.http.impl.classic.CloseableHttpClient httpClient) Sets a customCloseableHttpClientfor token requests (optional). If not set, a default client is created viaHttpClients.createDefault(). -
objectMapper
public OAuth2ClientCredentialsProvider.Builder objectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper) Sets a customObjectMapperfor parsing token responses (optional). If not set, a default instance is created. -
build
-