Package com.azure.identity
Class EnvironmentCredentialBuilder
- java.lang.Object
-
- com.azure.identity.CredentialBuilderBase<EnvironmentCredentialBuilder>
-
- com.azure.identity.EnvironmentCredentialBuilder
-
public class EnvironmentCredentialBuilder extends CredentialBuilderBase<EnvironmentCredentialBuilder>
Fluent credential builder for instantiating aEnvironmentCredential
.- See Also:
EnvironmentCredential
-
-
Constructor Summary
Constructors Constructor Description EnvironmentCredentialBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EnvironmentCredentialBuilder
authorityHost(String authorityHost)
Specifies the Azure Active Directory endpoint to acquire tokens.EnvironmentCredential
build()
Creates a newEnvironmentCredential
with the current configurations.EnvironmentCredentialBuilder
executorService(ExecutorService executorService)
Specifies the ExecutorService to be used to execute the authentication requests.-
Methods inherited from class com.azure.identity.CredentialBuilderBase
configuration, httpClient, httpPipeline, maxRetry, proxyOptions, retryTimeout
-
-
-
-
Method Detail
-
authorityHost
public EnvironmentCredentialBuilder authorityHost(String authorityHost)
Specifies the Azure Active Directory endpoint to acquire tokens.- Parameters:
authorityHost
- the Azure Active Directory endpoint- Returns:
- An updated instance of this builder with the authority host set as specified.
-
executorService
public EnvironmentCredentialBuilder executorService(ExecutorService executorService)
Specifies the ExecutorService to be used to execute the authentication requests. Developer is responsible for maintaining the lifecycle of the 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.
- Parameters:
executorService
- the executor service to use for executing authentication requests.- Returns:
- An updated instance of this builder with the executor service set as specified.
-
build
public EnvironmentCredential build()
Creates a newEnvironmentCredential
with the current configurations.- Returns:
- a
EnvironmentCredential
with the current configurations.
-
-