OAuth2ClientBuilder
A Java-idiomatic builder for creating instances of OAuth2Client.
This builder provides method-chaining setters for optional parameters and delegates to the Kotlin OAuth2ClientBuilder for the actual construction.
Pass the base org URL as issuerUrl and optionally call setAuthorizationServerId to target a custom authorization server. The effective issuer URL used for OIDC discovery is derived as:
No authorization server ID: issuerUrl is used as-is (org authorization server).
With authorization server ID:
"$issuerUrl/oauth2/$authorizationServerId"(custom authorization server).
Parameters
The base URL of the Okta org (e.g. "https://your-domain.okta.com"). Must use HTTPS.
The client ID of the application.
The OAuth 2.0 scopes the application is requesting.
Functions
Creates an OAuth2Client instance with the configured parameters.
Sets the access token validator. When set, access tokens are validated via at_hash claim.
Sets the ACR values.
Allows browser-based authorization flows to fall back to the classic authorization URL when PAR is optional and unavailable/fails.
Sets the HTTP executor used for all network requests.
Sets the authorization server ID used to target a custom authorization server.
Sets the cache for optimizing network calls.
Sets the provider for private_key_jwt (or similar JWT-based) client authentication.
Sets the client secret for confidential clients.
Sets the clock used for time-sensitive operations.
Sets the dispatcher for compute-bound operations.
Sets the device secret validator. When set, device secrets are validated via ds_hash claim.
Enables Pushed Authorization Requests (PAR) for browser-based authorization flows.
Sets optional per-endpoint URL overrides.
Sets the ID token validator. When set, ID tokens are validated after token refresh.
Sets the dispatcher for IO-bound operations.
Sets the JSON serializer used for encoding/decoding responses.
Sets the callback invoked when an HTTP 429 rate-limit response is received.