cached

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.


fun ConfigurableTokenSource.cached(store: TokenStore = InMemoryTokenStore(), validator: TokenValidator = defaultValidator): CachingConfigurableTokenSource

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

If the request options passed to ConfigurableTokenSource.fetch change, a new token will be fetched.