-
public final class CachingTokenSourceKt
-
-
Method Summary
Modifier and Type Method Description final static CachingFixedTokenSourcecached(FixedTokenSource $self, TokenStore store, Function2<TokenRequestOptions, TokenSourceResponse, Boolean> validator)Wraps the token store with a cache so that it reuses the token as long as it is valid. final static CachingConfigurableTokenSourcecached(ConfigurableTokenSource $self, TokenStore store, Function2<TokenRequestOptions, TokenSourceResponse, Boolean> validator)Wraps the token store with a cache so that it reuses the token as long as it is valid. final static BooleanhasValidToken(TokenSourceResponse $self, Duration tolerance, Date date)Validates whether the JWT token is still valid. -
-
Method Detail
-
cached
final static CachingFixedTokenSource cached(FixedTokenSource $self, TokenStore store, Function2<TokenRequestOptions, TokenSourceResponse, Boolean> validator)
Wraps the token store with a cache so that it reuses the token as long as it is valid.
-
cached
final static CachingConfigurableTokenSource cached(ConfigurableTokenSource $self, TokenStore store, Function2<TokenRequestOptions, TokenSourceResponse, Boolean> validator)
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.
-
hasValidToken
final static Boolean hasValidToken(TokenSourceResponse $self, Duration tolerance, Date date)
Validates whether the JWT token is still valid.
-
-
-
-