Class SimpleTokenCache


  • public class SimpleTokenCache
    extends Object
    A token cache that supports caching a token and refreshing it.
    • Constructor Detail

      • SimpleTokenCache

        public SimpleTokenCache​(Supplier<Mono<AccessToken>> tokenSupplier)
        Creates an instance of RefreshableTokenCredential with default scheme "Bearer".
        Parameters:
        tokenSupplier - a method to get a new token
    • Method Detail

      • getToken

        public Mono<AccessToken> getToken()
        Asynchronously get a token from either the cache or replenish the cache with a new token.
        Returns:
        a Publisher that emits an AccessToken