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 aClientCertificateCredential.- See Also:
ClientCertificateCredential
-
-
Constructor Summary
Constructors Constructor Description ClientCertificateCredentialBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ClientCertificateCredentialbuild()Creates a newClientCertificateCredentialwith the current configurations.ClientCertificateCredentialBuilderpemCertificate(String certificatePath)Sets the path of the PEM certificate for authenticating to AAD.ClientCertificateCredentialBuilderpfxCertificate(String certificatePath, String clientCertificatePassword)Sets the path and password of the PFX certificate for authenticating to AAD.ClientCertificateCredentialBuildersendCertificateChain(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.ClientCertificateCredentialBuildertokenCachePersistenceOptions(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
authorityHost, clientId, executorService, tenantId
-
Methods inherited from class com.azure.identity.CredentialBuilderBase
configuration, enableAccountIdentifierLogging, httpClient, httpPipeline, maxRetry, proxyOptions, retryTimeout
-
-
-
-
Method Detail
-
pemCertificate
public ClientCertificateCredentialBuilder pemCertificate(String certificatePath)
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
public ClientCertificateCredentialBuilder 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. 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
public ClientCertificateCredential build()
Creates a newClientCertificateCredentialwith the current configurations.- Returns:
- a
ClientCertificateCredentialwith the current configurations.
-
-