Package com.azure.identity
Class CredentialBuilderBase<T extends CredentialBuilderBase<T>>
java.lang.Object
com.azure.identity.CredentialBuilderBase<T>
- Type Parameters:
T
- the type of the credential builder
- Direct Known Subclasses:
AadCredentialBuilderBase
,AzureCliCredentialBuilder
,AzurePowerShellCredentialBuilder
,DefaultAzureCredentialBuilder
,EnvironmentCredentialBuilder
,IntelliJCredentialBuilder
,ManagedIdentityCredentialBuilder
,VisualStudioCodeCredentialBuilder
The base class for all the credential builders.
-
Method Summary
Modifier and TypeMethodDescriptionconfiguration
(Configuration configuration) Sets the configuration store that is used during construction of the credential.Enables account identifiers to be logged on client side for debugging/monitoring purposes.httpClient
(HttpClient client) Sets the HTTP client to use for sending and receiving requests to and from the service.httpPipeline
(HttpPipeline httpPipeline) Specifies the HttpPipeline to send all requests.maxRetry
(int maxRetry) Specifies the max number of retries when an authentication request fails.proxyOptions
(ProxyOptions proxyOptions) Deprecated.retryTimeout
(Function<Duration, Duration> retryTimeout) Specifies a Function to calculate seconds of timeout on every retried request.
-
Method Details
-
maxRetry
Specifies the max number of retries when an authentication request fails.- Parameters:
maxRetry
- the number of retries- Returns:
- An updated instance of this builder with the max retry set as specified.
-
retryTimeout
Specifies a Function to calculate seconds of timeout on every retried request.- Parameters:
retryTimeout
- the Function that returns a timeout in seconds given the number of retry- Returns:
- An updated instance of this builder with the retry timeout set as specified.
-
proxyOptions
Deprecated.Configure the proxy options on theHttpClient
instead and then set that client on the credential usinghttpClient(HttpClient)
.Specifies the options for proxy configuration.- Parameters:
proxyOptions
- the options for proxy configuration- Returns:
- An updated instance of this builder with the proxy options set as specified.
-
httpPipeline
Specifies the HttpPipeline to send all requests. This setting overrides the others.- Parameters:
httpPipeline
- the HttpPipeline to send all requests- Returns:
- An updated instance of this builder with the http pipeline set as specified.
-
httpClient
Sets the HTTP client to use for sending and receiving requests to and from the service.- Parameters:
client
- The HTTP client to use for requests.- Returns:
- An updated instance of this builder with the http client set as specified.
- Throws:
NullPointerException
- Ifclient
isnull
.
-
configuration
Sets the configuration store that is used during construction of the credential. The default configuration store is a clone of theglobal configuration store
.- Parameters:
configuration
- The configuration store used to load Env variables and/or properties from.- Returns:
- An updated instance of this builder with the configuration store set as specified.
-
enableAccountIdentifierLogging
Enables account identifiers to be logged on client side for debugging/monitoring purposes. By default, it is disabled.The Account Identifier logs can contain sensitive information and should be enabled on protected machines only. Enabling this logs Application ID, Object ID, Tenant ID and User Principal Name at INFO level when an access token is successfully retrieved. Ensure that INFO level logs are enabled to see the account identifier logs.
- Returns:
- An updated instance of this builder.
-
HttpClient
instead and then set that client on the credential usinghttpClient(HttpClient)
.