Package com.azure.core.credential
Class SimpleTokenCache
java.lang.Object
com.azure.core.credential.SimpleTokenCache
A token cache that supports caching a token and refreshing it.
-
Constructor Summary
ConstructorDescriptionSimpleTokenCache
(Supplier<Mono<AccessToken>> tokenSupplier) Creates an instance of RefreshableTokenCredential with default scheme "Bearer". -
Method Summary
Modifier and TypeMethodDescriptiongetToken()
Asynchronously get a token from either the cache or replenish the cache with a new token.
-
Constructor Details
-
SimpleTokenCache
Creates an instance of RefreshableTokenCredential with default scheme "Bearer".- Parameters:
tokenSupplier
- a method to get a new token
-
-
Method Details
-
getToken
Asynchronously get a token from either the cache or replenish the cache with a new token.- Returns:
- a Publisher that emits an AccessToken
-