Bearer

class Bearer(tokenProvider: suspend () -> String?) : KAuthProvider(source)

Injects Authorization: Bearer <token>.

Parameters

tokenProvider

Suspend lambda returning the current token. Called on every request, so token rotation is handled automatically (e.g. reading from a DataStore).

Constructors

Link copied to clipboard
constructor(tokenProvider: suspend () -> String?)