Credential
Deprecated
Credential is deprecated in favor of the KMP variant, which works on Android and JVM. Use com.okta.authfoundation.credential.kmp.TokenCredentialManager to manage credentials, and com.okta.authfoundation.credential.kmp.Credential for the resulting immutable snapshots. This class will be removed in a future major release.
Convenience object that wraps a Token, providing methods and properties for interacting with credential resources.
This class can be used as a convenience mechanism for managing stored credentials, performing operations on or for a user using their credentials, and interacting with resources scoped to the credential.
Note: Credential itself never invokes biometric authentication directly; all biometric-gated token decryption is delegated entirely to TokenEncryptionHandler (which, in turn, uses BiometricAuthenticator/AndroidBiometricAuthenticator).
Types
Properties
Functions
Returns an Interceptor that can be can be added to an OkHttpClient via OkHttpClient.Builder.addInterceptor to access a Resource Server.
Removes this Credential from the associated CredentialDataSource. This Credential should not be used after it's been removed.
Removes this Credential from the associated CredentialDataSource. This Credential should not be used after it's been removed.
Checks to see if the current access token is valid, and if it is, returns it. If there is no Token associated with the Credential, null is returned.
Returns a Flow that emits the current Token that's stored and associated with this Credential.
Performs the OIDC User Info call, which returns claims associated with this Credential.
Returns a valid access token if one is present. If the access token is invalid, and there is a refresh token, a Token refresh is attempted via Credential.refreshToken. If the refresh results in a valid access token, it is returned.
Retrieve the Jwt associated with the Token.idToken field.
Performs a call to the Authorization Server to validate the specified TokenType.
Attempt to refresh the Token associated with this Credential.
Attempt to refresh the Token associated with this Credential, forwarding additional form body parameters to the token endpoint.
Attempt to revoke all available tokens.
Attempt to revoke the specified TokenType.
Returns the scopes associated with the associated Token if present, otherwise the default scopes associated with the OAuth2Client.
Set tags for this Credential.