Class ClientCertificateCredential | Azure SDK for Net
Christopher Ramos
Published Feb 16, 2026
Inheritance
ClientCertificateCredential
Namespace: Azure.Identity
Assembly: Azure.Identity.dll
Syntax
public class ClientCertificateCredential : Azure.Core.TokenCredential Constructors
ClientCertificateCredential()
Protected constructor for mocking.
Declaration
protected ClientCertificateCredential (); ClientCertificateCredential(String, String, X509Certificate2)
Creates an instance of the ClientCertificateCredential with the details needed to authenticate against Azure Active Directory with the specified certificate.
Declaration
public ClientCertificateCredential (string tenantId, string clientId, System.Security.Cryptography.X509Certificates.X509Certificate2 clientCertificate); Parameters
| String tenantId The Azure Active Directory tenant (directory) Id of the service principal. |
| String clientId The client (application) ID of the service principal |
| X509Certificate2 clientCertificate The authentication X509 Certificate of the service principal |
ClientCertificateCredential(String, String, String)
Creates an instance of the ClientCertificateCredential with the details needed to authenticate against Azure Active Directory with the specified certificate.
Declaration
public ClientCertificateCredential (string tenantId, string clientId, string clientCertificatePath); Parameters
| String tenantId The Azure Active Directory tenant (directory) Id of the service principal. |
| String clientId The client (application) ID of the service principal |
| String clientCertificatePath The path to a file which contains both the client certificate and private key. |
ClientCertificateCredential(String, String, X509Certificate2, TokenCredentialOptions)
Creates an instance of the ClientCertificateCredential with the details needed to authenticate against Azure Active Directory with the specified certificate.
Declaration
public ClientCertificateCredential (string tenantId, string clientId, System.Security.Cryptography.X509Certificates.X509Certificate2 clientCertificate, Azure.Identity.TokenCredentialOptions options); Parameters
| String tenantId The Azure Active Directory tenant (directory) Id of the service principal. |
| String clientId The client (application) ID of the service principal |
| X509Certificate2 clientCertificate The authentication X509 Certificate of the service principal |
| TokenCredentialOptions options Options that allow to configure the management of the requests sent to the Azure Active Directory service. |
ClientCertificateCredential(String, String, String, TokenCredentialOptions)
Creates an instance of the ClientCertificateCredential with the details needed to authenticate against Azure Active Directory with the specified certificate.
Declaration
public ClientCertificateCredential (string tenantId, string clientId, string clientCertificatePath, Azure.Identity.TokenCredentialOptions options); Parameters
| String tenantId The Azure Active Directory tenant (directory) Id of the service principal. |
| String clientId The client (application) ID of the service principal |
| String clientCertificatePath The path to a file which contains both the client certificate and private key. |
| TokenCredentialOptions options Options that allow to configure the management of the requests sent to the Azure Active Directory service. |
Methods
GetToken(TokenRequestContext, CancellationToken)
Obtains a token from the Azure Active Directory service, using the specified X509 certificate to authenticate. This method is called by Azure SDK clients. It isn't intended for use in application code.
Declaration
public override Azure.Core.AccessToken GetToken (Azure.Core.TokenRequestContext requestContext, System.Threading.CancellationToken cancellationToken = null); Parameters
Returns
GetTokenAsync(TokenRequestContext, CancellationToken)
Obtains a token from the Azure Active Directory service, using the specified X509 certificate to authenticate. This method is called by Azure SDK clients. It isn't intended for use in application code.
Declaration
[System.Diagnostics.DebuggerStepThrough]
public override System.Threading.Tasks.ValueTask<Azure.Core.AccessToken> GetTokenAsync (Azure.Core.TokenRequestContext requestContext, System.Threading.CancellationToken cancellationToken = null);