Class ClientCertificateCredential

  • All Implemented Interfaces:
    com.azure.core.credential.TokenCredential

    public class ClientCertificateCredential
    extends Object
    implements com.azure.core.credential.TokenCredential
    An AAD credential that acquires a token with a client certificate for an AAD application.

    Sample: Construct a simple ClientCertificateCredential

     ClientCertificateCredential credential1 = new ClientCertificateCredentialBuilder()
         .tenantId(tenantId)
         .clientId(clientId)
         .pemCertificate("<PATH-TO-PEM-CERTIFICATE>")
         .build();
     

    Sample: Construct a ClientCertificateCredential behind a proxy

     ClientCertificateCredential credential2 = new ClientCertificateCredentialBuilder()
         .tenantId(tenantId)
         .clientId(clientId)
         .pfxCertificate("<PATH-TO-PFX-CERTIFICATE>", "P@s$w0rd")
         .proxyOptions(new ProxyOptions(Type.HTTP, new InetSocketAddress("10.21.32.43", 5465)))
         .build();
     
    • Method Detail

      • getToken

        public Mono<com.azure.core.credential.AccessToken> getToken​(com.azure.core.credential.TokenRequestContext request)
        Specified by:
        getToken in interface com.azure.core.credential.TokenCredential