Package com.azure.identity
Class ClientCertificateCredential
java.lang.Object
com.azure.identity.ClientCertificateCredential
- All Implemented Interfaces:
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 Summary
Modifier and TypeMethodDescriptiongetToken(TokenRequestContext request) Asynchronously get a token for a given resource/audience.
-
Method Details
-
getToken
Description copied from interface:TokenCredentialAsynchronously get a token for a given resource/audience. This method is called automatically by Azure SDK client libraries. You may call this method directly, but you must also handle token caching and token refreshing.- Specified by:
getTokenin interfaceTokenCredential- Parameters:
request- the details of the token request- Returns:
- a Publisher that emits a single access token
-