Class TokenCredentialAuthProvider

java.lang.Object
com.microsoft.graph.authentication.BaseAuthenticationProvider
com.microsoft.graph.authentication.TokenCredentialAuthProvider
All Implemented Interfaces:
IAuthenticationProvider

public class TokenCredentialAuthProvider extends BaseAuthenticationProvider
An implementation of the Authentication Provider with Azure-identity
  • Constructor Details

    • TokenCredentialAuthProvider

      public TokenCredentialAuthProvider(@Nonnull com.azure.core.credential.TokenCredential tokenCredential)
      Creates an Authentication provider using a passed in TokenCredential
      Parameters:
      tokenCredential - Credential object inheriting the TokenCredential interface used to instantiate the Auth Provider
    • TokenCredentialAuthProvider

      public TokenCredentialAuthProvider(@Nonnull List<String> scopes, @Nonnull com.azure.core.credential.TokenCredential tokenCredential)
      Creates an Authentication provider using a TokenCredential and list of scopes
      Parameters:
      tokenCredential - Credential object inheriting the TokenCredential interface used to instantiate the Auth Provider
      scopes - Specified desired scopes of the Auth Provider
  • Method Details

    • getAuthorizationTokenAsync

      @Nonnull public CompletableFuture<String> getAuthorizationTokenAsync(@Nonnull URL requestUrl)
      Returns an AccessToken as a string
      Parameters:
      requestUrl - the outgoing request URL
      Returns:
      String representing the retrieved AccessToken