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 Android, the existing com.okta.authfoundation.credential.Credential class implements this interface while preserving mutable internal behavior as a transitional adapter. On JVM and other KMP targets, CredentialImpl provides the default immutable implementation.
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.
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.