Class AzureIdentityAccessTokenProvider

java.lang.Object
com.microsoft.kiota.authentication.AzureIdentityAccessTokenProvider
All Implemented Interfaces:
com.microsoft.kiota.authentication.AccessTokenProvider

public class AzureIdentityAccessTokenProvider extends Object implements com.microsoft.kiota.authentication.AccessTokenProvider
Implementation of AccessTokenProvider that supports implementations of TokenCredential from Azure.Identity.
  • Constructor Details

    • AzureIdentityAccessTokenProvider

      public AzureIdentityAccessTokenProvider(@Nonnull com.azure.core.credential.TokenCredential tokenCredential, @Nonnull String[] allowedHosts, @Nonnull String... scopes)
      Creates a new instance of AzureIdentityAccessTokenProvider.
      Parameters:
      tokenCredential - The Azure.Identity.TokenCredential implementation to use.
      allowedHosts - The list of allowed hosts for which to request access tokens.
      scopes - The scopes to request access tokens for.
    • AzureIdentityAccessTokenProvider

      public AzureIdentityAccessTokenProvider(@Nonnull com.azure.core.credential.TokenCredential tokenCredential, @Nonnull String[] allowedHosts, @Nullable ObservabilityOptions observabilityOptions, @Nonnull String... scopes)
      Creates a new instance of AzureIdentityAccessTokenProvider.
      Parameters:
      tokenCredential - The Azure.Identity.TokenCredential implementation to use.
      allowedHosts - The list of allowed hosts for which to request access tokens.
      observabilityOptions - The observability options to use.
      scopes - The scopes to request access tokens for.
    • AzureIdentityAccessTokenProvider

      public AzureIdentityAccessTokenProvider(@Nonnull com.azure.core.credential.TokenCredential tokenCredential, @Nonnull String[] allowedHosts, @Nullable ObservabilityOptions observabilityOptions, boolean isCaeEnabled, @Nonnull String... scopes)
      Creates a new instance of AzureIdentityAccessTokenProvider.
      Parameters:
      tokenCredential - The Azure.Identity.TokenCredential implementation to use.
      allowedHosts - The list of allowed hosts for which to request access tokens.
      observabilityOptions - The observability options to use.
      isCaeEnabled - A flag to enable or disable the Continuous Access Evaluation.
      scopes - The scopes to request access tokens for.
  • Method Details

    • getAuthorizationToken

      @Nonnull public String getAuthorizationToken(@Nonnull URI uri, @Nullable Map<String,Object> additionalAuthenticationContext)
      Specified by:
      getAuthorizationToken in interface com.microsoft.kiota.authentication.AccessTokenProvider
    • getAllowedHostsValidator

      @Nonnull public com.microsoft.kiota.authentication.AllowedHostsValidator getAllowedHostsValidator()
      Specified by:
      getAllowedHostsValidator in interface com.microsoft.kiota.authentication.AccessTokenProvider