Class ClientCertificateCredentialBuilder


public class ClientCertificateCredentialBuilder extends AadCredentialBuilderBase<ClientCertificateCredentialBuilder>
Fluent credential builder for instantiating a ClientCertificateCredential.
See Also:
  • Constructor Details

    • ClientCertificateCredentialBuilder

      public ClientCertificateCredentialBuilder()
  • Method Details

    • 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 certificate
      clientCertificatePassword - 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

      Creates a new ClientCertificateCredential with the current configurations.
      Returns:
      a ClientCertificateCredential with the current configurations.