Class AzureTokenCredentialsAdapter

  • All Implemented Interfaces:
    com.microsoft.rest.credentials.ServiceClientCredentials

    class AzureTokenCredentialsAdapter
    extends com.microsoft.azure.credentials.AzureTokenCredentials
    Convert token credential in azure-identity to legacy AzureTokenCredentials Refers https://github.com/jongio/azidext/blob/master/java/src/main/java/com/azure/identity/extensions/AzureIdentityCredentialAdapter.java
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private Map<String,​com.azure.core.credential.AccessToken> accessTokenCache  
      private com.azure.core.credential.TokenCredential tokenCredential  
    • Constructor Summary

      Constructors 
      Constructor Description
      AzureTokenCredentialsAdapter​(com.microsoft.azure.AzureEnvironment environment, String tenantId, com.azure.core.credential.TokenCredential tokenCredential)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static com.microsoft.azure.credentials.AzureTokenCredentials from​(com.azure.core.management.AzureEnvironment env, String tenantId, com.azure.core.credential.TokenCredential tokenCredential)  
      String getToken​(String endpoint)  
      • Methods inherited from class com.microsoft.azure.credentials.AzureTokenCredentials

        applyCredentialsFilter, defaultSubscriptionId, domain, environment, getToken, proxy, sslSocketFactory, withDefaultSubscriptionId, withProxy, withSslSocketFactory
      • Methods inherited from class com.microsoft.rest.credentials.TokenCredentials

        getScheme
    • Field Detail

      • tokenCredential

        private final com.azure.core.credential.TokenCredential tokenCredential
      • accessTokenCache

        private final Map<String,​com.azure.core.credential.AccessToken> accessTokenCache
    • Constructor Detail

      • AzureTokenCredentialsAdapter

        AzureTokenCredentialsAdapter​(com.microsoft.azure.AzureEnvironment environment,
                                     String tenantId,
                                     com.azure.core.credential.TokenCredential tokenCredential)
    • Method Detail

      • getToken

        public String getToken​(String endpoint)
        Specified by:
        getToken in class com.microsoft.azure.credentials.AzureTokenCredentials
      • from

        public static com.microsoft.azure.credentials.AzureTokenCredentials from​(com.azure.core.management.AzureEnvironment env,
                                                                                 String tenantId,
                                                                                 com.azure.core.credential.TokenCredential tokenCredential)