CachingFixedTokenSource

Constructors

Link copied to clipboard
constructor(source: FixedTokenSource, store: TokenStore, validator: TokenValidator)

Functions

Link copied to clipboard
fun FixedTokenSource.cached(store: TokenStore = InMemoryTokenStore(), validator: TokenValidator = defaultValidator): CachingFixedTokenSource

Wraps the token store with a cache so that it reuses the token as long as it is valid.

Link copied to clipboard

Get the cached credentials if one exists.

Link copied to clipboard
open suspend override fun fetch(): TokenSourceResponse
Link copied to clipboard
open suspend override fun fetchFromSource(options: TokenRequestOptions?): TokenSourceResponse

Implement this to fetch the TokenSourceResponse from the token source.

Link copied to clipboard
suspend fun invalidate()

Invalidate the cached credentials, forcing a fresh fetch on the next request.