OAuth2EndpointOverrides

class OAuth2EndpointOverrides(val authorizationEndpoint: String? = null, val tokenEndpoint: String? = null, val userInfoEndpoint: String? = null, val jwksUri: String? = null, val introspectionEndpoint: String? = null, val revocationEndpoint: String? = null, val endSessionEndpoint: String? = null, val deviceAuthorizationEndpoint: String? = null, val pushedAuthorizationRequestEndpoint: String? = null)

Optional per-endpoint URL overrides for an OAuth2Client.

When provided via OAuth2ClientBuilder.endpointOverrides, each non-null field replaces the corresponding URL that would otherwise be obtained from the OpenID Connect discovery document.

Skip-discovery optimization: When all 8 fields are non-null, the SDK skips the HTTP request to {issuerUrl}/.well-known/openid-configuration entirely and uses the override values directly. This is useful for environments where the discovery URL is unavailable or when startup latency must be minimized.

Partial overrides: When only some fields are non-null, the discovery document is still fetched. The override values then win over the discovered values for those specific fields.

All non-null values must be valid HTTPS URLs; validation occurs at OAuth2ClientBuilder build time.

Example — override only the token endpoint:

val client = OAuth2ClientBuilder.create(
issuerUrl = "https://your-okta-domain.okta.com/oauth2/default",
clientId = "client-id",
scope = listOf("openid"),
) {
endpointOverrides = OAuth2EndpointOverrides(
tokenEndpoint = "https://proxy.example.com/token"
)
}.getOrThrow()

Parameters

authorizationEndpoint

override URL for the authorization endpoint, or null to use discovery.

tokenEndpoint

override URL for the token endpoint, or null to use discovery.

userInfoEndpoint

override URL for the user-info endpoint, or null to use discovery.

jwksUri

override URL for the JWKS URI, or null to use discovery.

introspectionEndpoint

override URL for the introspection endpoint, or null to use discovery.

revocationEndpoint

override URL for the revocation endpoint, or null to use discovery.

endSessionEndpoint

override URL for the end-session (logout) endpoint, or null to use discovery.

deviceAuthorizationEndpoint

override URL for the device authorization endpoint, or null to use discovery.

pushedAuthorizationRequestEndpoint

override URL for the Pushed Authorization Request (PAR) endpoint, or null to use discovery. Not counted toward the skip-discovery optimization above — PAR is opt-in via OAuth2ClientBuilder.enablePushedAuthorizationRequests, so leaving this null never blocks skipping discovery for the other 8 fields. Set this when all-8-fields skip-discovery is used together with PAR, since discovery (the normal source of this endpoint) is bypassed.

Constructors

Link copied to clipboard
constructor(authorizationEndpoint: String? = null, tokenEndpoint: String? = null, userInfoEndpoint: String? = null, jwksUri: String? = null, introspectionEndpoint: String? = null, revocationEndpoint: String? = null, endSessionEndpoint: String? = null, deviceAuthorizationEndpoint: String? = null, pushedAuthorizationRequestEndpoint: String? = null)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard