Package com.azure.identity
Class ClientCertificateCredentialBuilder
java.lang.Object
com.azure.identity.CredentialBuilderBase<T>
com.azure.identity.AadCredentialBuilderBase<ClientCertificateCredentialBuilder>
com.azure.identity.ClientCertificateCredentialBuilder
public class ClientCertificateCredentialBuilder
extends AadCredentialBuilderBase<ClientCertificateCredentialBuilder>
Fluent credential builder for instantiating a
ClientCertificateCredential
.- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Creates a newClientCertificateCredential
with the current configurations.pemCertificate
(String certificatePath) Sets the path of the PEM certificate for authenticating to AAD.pfxCertificate
(String certificatePath, String clientCertificatePassword) Sets the path and password of the PFX certificate for authenticating to AAD.sendCertificateChain
(boolean sendCertificateChain) Specifies if the x5c claim (public key of the certificate) should be sent as part of the authentication request and enable subject name / issuer based authentication.tokenCachePersistenceOptions
(TokenCachePersistenceOptions tokenCachePersistenceOptions) Configures the persistent shared token cache options and enables the persistent token cache which is disabled by default.Methods inherited from class com.azure.identity.AadCredentialBuilderBase
additionallyAllowedTenants, additionallyAllowedTenants, authorityHost, clientId, executorService, tenantId
Methods inherited from class com.azure.identity.CredentialBuilderBase
configuration, enableAccountIdentifierLogging, httpClient, httpPipeline, maxRetry, proxyOptions, retryTimeout
-
Constructor Details
-
ClientCertificateCredentialBuilder
public ClientCertificateCredentialBuilder()
-
-
Method Details
-
pemCertificate
Sets the path of the PEM certificate for authenticating to AAD.- Parameters:
certificatePath
- the PEM file containing the certificate- Returns:
- An updated instance of this builder.
-
pfxCertificate
public ClientCertificateCredentialBuilder pfxCertificate(String certificatePath, String clientCertificatePassword) Sets the path and password of the PFX certificate for authenticating to AAD.- Parameters:
certificatePath
- the password protected PFX file containing the certificateclientCertificatePassword
- the password protecting the PFX file- Returns:
- An updated instance of this builder.
-
tokenCachePersistenceOptions
public ClientCertificateCredentialBuilder tokenCachePersistenceOptions(TokenCachePersistenceOptions tokenCachePersistenceOptions) Configures the persistent shared token cache options and enables the persistent token cache which is disabled by default. If configured, the credential will store tokens in a cache persisted to the machine, protected to the current user, which can be shared by other credentials and processes.- Parameters:
tokenCachePersistenceOptions
- the token cache configuration options- Returns:
- An updated instance of this builder with the token cache options configured.
-
sendCertificateChain
Specifies if the x5c claim (public key of the certificate) should be sent as part of the authentication request and enable subject name / issuer based authentication. The default value is false.- Parameters:
sendCertificateChain
- the flag to indicate if certificate chain should be sent as part of authentication request.- Returns:
- An updated instance of this builder.
-
build
Creates a newClientCertificateCredential
with the current configurations.- Returns:
- a
ClientCertificateCredential
with the current configurations.
-