Interface TokenCredential

All Known Implementing Classes:
AuthorizationCodeCredential, AzureCliCredential, AzurePowerShellCredential, BasicAuthenticationCredential, ChainedTokenCredential, ClientAssertionCredential, ClientCertificateCredential, ClientSecretCredential, DefaultAzureCredential, DeviceCodeCredential, EnvironmentCredential, IntelliJCredential, InteractiveBrowserCredential, ManagedIdentityCredential, OnBehalfOfCredential, SharedTokenCacheCredential, UsernamePasswordCredential, VisualStudioCodeCredential
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface TokenCredential
The interface for credentials that can provide a token.
  • Method Summary

    Modifier and Type
    Method
    Description
    Asynchronously get a token for a given resource/audience.
  • Method Details

    • getToken

      Mono<AccessToken> getToken(TokenRequestContext request)
      Asynchronously get a token for a given resource/audience. This method is called automatically by Azure SDK client libraries. You may call this method directly, but you must also handle token caching and token refreshing.
      Parameters:
      request - the details of the token request
      Returns:
      a Publisher that emits a single access token