Class ManagedIdentityCredential

java.lang.Object
com.azure.identity.ManagedIdentityCredential
All Implemented Interfaces:
TokenCredential

public final class ManagedIdentityCredential extends Object implements TokenCredential
The base class for Managed Service Identity token based credentials.
  • Method Details

    • getClientId

      public String getClientId()
      Gets the client ID of user assigned or system assigned identity.
      Returns:
      the client ID of user assigned or system assigned identity.
    • getToken

      public Mono<AccessToken> getToken(TokenRequestContext request)
      Description copied from interface: TokenCredential
      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.
      Specified by:
      getToken in interface TokenCredential
      Parameters:
      request - the details of the token request
      Returns:
      a Publisher that emits a single access token