public class DefaultAzureCredentialBuilder extends CredentialBuilderBase<DefaultAzureCredentialBuilder>
DefaultAzureCredential
.DefaultAzureCredential
Constructor and Description |
---|
DefaultAzureCredentialBuilder() |
Modifier and Type | Method and Description |
---|---|
DefaultAzureCredentialBuilder |
authorityHost(String authorityHost)
Specifies the Azure Active Directory endpoint to acquire tokens.
|
DefaultAzureCredential |
build()
Creates new
DefaultAzureCredential with the configured options set. |
DefaultAzureCredentialBuilder |
excludeAzureCliCredential()
Excludes the
AzureCliCredential from the DefaultAzureCredential authentication flow. |
DefaultAzureCredentialBuilder |
excludeEnvironmentCredential()
Excludes the
EnvironmentCredential from the DefaultAzureCredential
authentication flow and disables reading authentication details from the process' environment
variables. |
DefaultAzureCredentialBuilder |
excludeManagedIdentityCredential()
Excludes the
ManagedIdentityCredential from the DefaultAzureCredential
authentication flow and disables authenticating with managed identity endpoints. |
DefaultAzureCredentialBuilder |
excludeSharedTokenCacheCredential()
Excludes the
SharedTokenCacheCredential from the DefaultAzureCredential
authentication flow and disables single sign on authentication with development tools which write
to the shared token cache. |
DefaultAzureCredentialBuilder |
executorService(ExecutorService executorService)
Specifies the ExecutorService to be used to execute the authentication requests.
|
httpClient, httpPipeline, maxRetry, proxyOptions, retryTimeout, tokenRefreshOffset
public DefaultAzureCredentialBuilder authorityHost(String authorityHost)
authorityHost
- the Azure Active Directory endpointpublic DefaultAzureCredentialBuilder excludeEnvironmentCredential()
EnvironmentCredential
from the DefaultAzureCredential
authentication flow and disables reading authentication details from the process' environment
variables.public DefaultAzureCredentialBuilder excludeManagedIdentityCredential()
ManagedIdentityCredential
from the DefaultAzureCredential
authentication flow and disables authenticating with managed identity endpoints.public DefaultAzureCredentialBuilder excludeSharedTokenCacheCredential()
SharedTokenCacheCredential
from the DefaultAzureCredential
authentication flow and disables single sign on authentication with development tools which write
to the shared token cache.public DefaultAzureCredentialBuilder excludeAzureCliCredential()
AzureCliCredential
from the DefaultAzureCredential
authentication flow.public DefaultAzureCredentialBuilder executorService(ExecutorService executorService)
If this is not configured, the ForkJoinPool.commonPool()
will be used which is
also shared with other application tasks. If the common pool is heavily used for other tasks, authentication
requests might starve and setting up this executor service should be considered.
The executor service and can be safely shutdown if the TokenCredential is no longer being used by the Azure SDK clients and should be shutdown before the application exits.
executorService
- the executor service to use for executing authentication requests.public DefaultAzureCredential build()
DefaultAzureCredential
with the configured options set.DefaultAzureCredential
with the current configurations.Copyright © 2020 Microsoft Corporation. All rights reserved.