OAuth2Client

Deprecated

The Android-only OAuth2Client is deprecated in favor of the KMP variant, which works on Android and JVM. Build one via OAuth2ClientBuilder.create(issuerUrl, clientId, scope) and use com.okta.authfoundation.client.kmp.OAuth2Client instead. This class will be removed in a future major release.

The client used for interacting with an Okta Authorization Server.

This is for low level access, and it's typically preferred to use a Credential, which streamlines usage.

Okta Developer Docs

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Functions

Link copied to clipboard
Link copied to clipboard

Performs the OIDC User Info call, which returns claims associated with the supplied accessToken.

Link copied to clipboard

Performs a call to the Authorization Server to validate the specified TokenType.

Link copied to clipboard
suspend fun jwks(): OAuth2ClientResult<Jwks>

Performs a call to the Authorization Server to fetch Jwks.

Link copied to clipboard
suspend fun OAuth2Client.performRequest(request: Request): OAuth2ClientResult<Response>
suspend fun <Raw, Dto> OAuth2Client.performRequest(deserializationStrategy: DeserializationStrategy<Raw>, request: Request, shouldAttemptJsonDeserialization: (Response) -> Boolean = { it.isSuccessful }, responseMapper: (Raw) -> Dto): OAuth2ClientResult<Dto>
Link copied to clipboard

Attempt to refresh the token.

suspend fun refreshToken(token: Token, extraRequestParameters: Map<String, String>): OAuth2ClientResult<Token>

Attempt to refresh the token, forwarding additional form body parameters to the token endpoint.

Link copied to clipboard
suspend fun revokeToken(revokeTokenType: RevokeTokenType, token: Token): OAuth2ClientResult<Unit>

Attempt to revoke the specified token.

Link copied to clipboard
suspend fun tokenRequest(request: Request, nonce: String? = null, maxAge: Int? = null, requestToken: Token? = null): OAuth2ClientResult<Token>