TokenProvider

fun interface TokenProvider

Supplies a Cognito access token for the X-Authorization header.

Deliberately one method with no notion of how a token is obtained. On a backend that is a client-credentials exchange; in an untrusted client it is a call to a service you control that performs the exchange for you. The SDK does not need to know which, and keeping it out of this interface is what lets an Android app hold no client secret.

Types

Link copied to clipboard
object Companion

Scope for the provider factories, such as caching.

Functions

Link copied to clipboard
abstract suspend fun token(): String

Return a currently-valid access token, minting or refreshing if needed.