CredentialImpl
Default cross-platform immutable implementation of Credential.
Each instance is a point-in-time snapshot: token and tags are val and never change. Methods that modify credential state return a Result wrapping a new CredentialImpl snapshot with the updated values.
Shared mutable state (deletion tracking, token flows, refresh deduplication) is managed by CredentialDataSource, keyed by credential id.
Used on JVM and other non-Android KMP targets. On Android, the existing com.okta.authfoundation.credential.Credential class provides a mutable adapter.
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.