TokenCredentialManager

class TokenCredentialManager(val client: OAuth2Client, storage: TokenStorage, val defaultIdStore: DefaultCredentialIdStore)

Cross-platform credential manager providing CRUD operations for credentials.

Holds the shared dependencies (client, storage, defaultIdStore) so callers don't need to pass them on every operation.

Credential lifecycle events are emitted on events. All active collectors receive every event independently. There is no replay; events emitted before a collector subscribes are not delivered.

Parameters

client

The OAuth2Client used for token operations.

storage

The TokenStorage for persisting tokens.

defaultIdStore

Store for the default credential ID.

Constructors

Link copied to clipboard
constructor(client: OAuth2Client, storage: TokenStorage, defaultIdStore: DefaultCredentialIdStore)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val events: ERROR CLASS: Symbol not found for SharedFlow<com/okta/authfoundation/events/Event>

A read-only flow of credential lifecycle events emitted by this manager.

Functions

Link copied to clipboard
suspend fun allIds(): ERROR CLASS: Symbol not found for Result<kotlin/collections/List<kotlin/String>>

Returns IDs of all stored credentials.

Link copied to clipboard
suspend fun find(where: (TokenMetadata) -> Boolean): ERROR CLASS: Symbol not found for Result<kotlin/collections/List<com/okta/authfoundation/credential/kmp/Credential>>

Returns all credentials matching the given where predicate.

suspend fun find(predicate: (Credential) -> Boolean): ERROR CLASS: Symbol not found for Result<kotlin/collections/List<com/okta/authfoundation/credential/kmp/Credential>>

Returns all credentials matching the given predicate.

Link copied to clipboard
suspend fun get(id: String): ERROR CLASS: Symbol not found for Result<com/okta/authfoundation/credential/kmp/Credential?>

Retrieves a credential by its id.

Link copied to clipboard
suspend fun getDefault(): ERROR CLASS: Symbol not found for Result<com/okta/authfoundation/credential/kmp/Credential?>

Returns the default credential, or null if no default has been set.

Link copied to clipboard
suspend fun metadata(id: String): ERROR CLASS: Symbol not found for Result<com/okta/authfoundation/credential/TokenMetadata?>

Returns metadata for the credential with id.

Link copied to clipboard
suspend fun setDefault(credential: Credential?): ERROR CLASS: Symbol not found for Result<kotlin/Unit>

Sets or clears the default credential.

Link copied to clipboard
suspend fun setMetadata(metadata: TokenMetadata): ERROR CLASS: Symbol not found for Result<kotlin/Unit>

Updates metadata for an existing credential.

Link copied to clipboard
suspend fun store(token: TokenData, tags: Map<String, String> = emptyMap()): ERROR CLASS: Symbol not found for Result<com/okta/authfoundation/credential/kmp/Credential>

Stores a new credential with the given token and optional tags.