All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.azure.identity.DefaultAzureCredential Maven / Gradle / Ivy

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package com.azure.identity;

import com.azure.core.annotation.Immutable;
import com.azure.core.credential.TokenCredential;

import java.util.List;

/**
 * Creates a credential using environment variables or the shared token cache. It tries to create a valid credential in
 * the following order:
 *
 * 
    *
  1. {@link EnvironmentCredential}
  2. *
  3. {@link ManagedIdentityCredential}
  4. *
  5. {@link SharedTokenCacheCredential}
  6. *
  7. {@link IntelliJCredential}
  8. *
  9. {@link VisualStudioCodeCredential}
  10. *
  11. {@link AzureCliCredential}
  12. *
  13. Fails if none of the credentials above could be created.
  14. *
*/ @Immutable public final class DefaultAzureCredential extends ChainedTokenCredential { /** * Creates default DefaultAzureCredential instance to use. This will use AZURE_CLIENT_ID, * AZURE_CLIENT_SECRET, and AZURE_TENANT_ID environment variables to create a * ClientSecretCredential. * * If these environment variables are not available, then this will use the Shared MSAL * token cache. * * @param tokenCredentials the list of credentials to execute for authentication. */ DefaultAzureCredential(List tokenCredentials) { super(tokenCredentials); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy