Credential
Cross-platform credential interface providing token management operations.
Instances are immutable snapshots: token, tags, and id never change after construction. Methods that modify credential state return a Result containing a new Credential snapshot.
On JVM and other KMP targets, CredentialImpl is the implementation. The Android-only com.okta.authfoundation.credential.Credential is a separate, deprecated type that shares only the CredentialIdentifier contract — it does not implement this interface.
Inheritors
Functions
Returns the access token string if it has not expired, or null if it has.
Deletes this credential from storage.
Returns a Flow that emits the current token and subsequent updates.
Fetches user info from the authorization server.
Introspects a specific token type at the authorization server.
Ensures the credential has a non-expired access token, refreshing if necessary.
Refreshes the token and returns a new credential snapshot.
Refreshes the token with additional form body parameters and returns a new credential snapshot.
Revokes all available token types (access token, refresh token, device secret).
Revokes a specific token type at the authorization server.
Updates the tags for this credential and returns a new snapshot.