TokenStorage

interface TokenStorage

Interface used to customize the way tokens are stored, updated, and removed throughout the lifecycle of an application.

A default implementation is provided, but for advanced use-cases, you may implement this protocol yourself and pass an instance to CredentialDataSource.createCredentialDataSource.

Warning: When implementing a custom TokenStorage class, it's vitally important that you do not directly invoke any of these methods yourself. These methods are intended to be called on-demand by the other AuthFoundation classes, and the behavior is undefined if these methods are called directly by the developer.

Types

Link copied to clipboard
class Entry(    val identifier: String,     val token: Token?,     val tags: Map<String, String>)

Represents the data to store in TokenStorage.

Functions

Link copied to clipboard
abstract suspend fun add(id: String)

Add a new entry to storage.

Link copied to clipboard
abstract suspend fun entries(): List<TokenStorage.Entry>

Used to access all Entrys in storage.

Link copied to clipboard
abstract suspend fun remove(id: String)

Remove an existing entry from storage.

Link copied to clipboard
abstract suspend fun replace(updatedEntry: TokenStorage.Entry)

Replace an existing Entry in storage with an updated Entry.