RoomTokenStorage

class RoomTokenStorage(database: TokenDatabase, encryptionHandler: TokenEncryptionHandler, configuration: OAuth2ClientConfiguration) : TokenStorage

Cross-platform TokenStorage implementation backed by Room.

The encryptionHandler encrypts/decrypts the access token before persistence. The configuration is used to reconstruct TokenData when reading tokens.

Parameters

database

the TokenDatabase instance (created via platform-specific builders).

encryptionHandler

the encryption strategy for token data.

configuration

the OAuth2ClientConfiguration used to reconstruct tokens.

Constructors

Link copied to clipboard
constructor(database: TokenDatabase, encryptionHandler: TokenEncryptionHandler, configuration: OAuth2ClientConfiguration)

Functions

Link copied to clipboard
open suspend override fun add(token: TokenInfo, metadata: TokenMetadata): ERROR CLASS: Symbol not found for Result<kotlin/Unit>

Stores a new token with associated metadata.

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

Returns the IDs of all stored tokens.

Link copied to clipboard
open suspend override fun getToken(id: String): ERROR CLASS: Symbol not found for Result<com/okta/authfoundation/client/TokenInfo>

Retrieves and decrypts the token with id.

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

Returns metadata for the token with id, or null if not found.

Link copied to clipboard
open suspend override fun remove(id: String): ERROR CLASS: Symbol not found for Result<kotlin/Unit>

Removes the token with id from storage. Does nothing if the provided id does not exist.

Link copied to clipboard
open suspend override fun replace(token: TokenInfo): ERROR CLASS: Symbol not found for Result<kotlin/Unit>

Replaces an existing token with the same ID atomically.

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

Updates the metadata for an existing token.