KTokenStore

interface KTokenStore(source)

Abstraction over token persistence.

Kindling provides three built-in implementations:

Implement this interface to plug in any other storage backend (Room, SQLCipher, system Keychain, etc.).

All methods are suspend — implementations may perform I/O safely.

Usage with KSessionManager:

val session = KSessionManager(
store = KEncryptedTokenStore(context) // swap freely
)

Inheritors

Functions

Link copied to clipboard
abstract suspend fun clear()

Removes all stored tokens.

Link copied to clipboard
abstract suspend fun getAccessToken(): String?

Returns the current access token, or null if none is stored.

Link copied to clipboard
abstract suspend fun getRefreshToken(): String?

Returns the current refresh token, or null if none is stored.

Link copied to clipboard
abstract suspend fun saveTokens(accessToken: String?, refreshToken: String?)

Persists both tokens.