Skip to content

Latest commit

 

History

History
78 lines (51 loc) · 3.64 KB

authentication-certificate-policy.md

File metadata and controls

78 lines (51 loc) · 3.64 KB
titledescriptionservicesauthorms.servicems.topicms.datems.author
Azure API Management policy reference - authentication-certificate | Microsoft Docs
Reference for the authentication-certificate policy available for use in Azure API Management. Provides policy usage, settings, and examples.
api-management
dlepow
azure-api-management
reference
07/23/2024
danlep

Authenticate with client certificate

[!INCLUDE api-management-availability-all-tiers]

Use the authentication-certificate policy to authenticate with a backend service using a client certificate. When the certificate is installed into API Management first, identify it first by its thumbprint or certificate ID (resourcename).

[!INCLUDE api-management-credentials-caution]

Caution

If the certificate references a certificate stored in Azure Key Vault, identify it using the certificate ID. When a key vault certificate is rotated, its thumbprint in API Management will change, and the policy will not resolve the new certificate if it is identified by thumbprint.

[!INCLUDE api-management-policy-generic-alert]

Policy statement

<authentication-certificatethumbprint="thumbprint"certificate-id="resource name"body="certificate byte array"password="optional password"/>

Attributes

AttributeDescriptionRequiredDefault
thumbprintThe thumbprint for the client certificate. Policy expressions are allowed.Either thumbprint or certificate-id can be present.N/A
certificate-idThe certificate resource name. Policy expressions are allowed.Either thumbprint or certificate-id can be present.N/A
bodyClient certificate as a byte array. Use if the certificate isn't retrieved from the built-in certificate store. Policy expressions are allowed.NoN/A
passwordPassword for the client certificate. Policy expressions are allowed.Use if certificate specified in body is password protected.N/A

Usage

Usage notes

  • We recommend configuring key vault certificates to manage certificates used to secure access to backend services.
  • If you configure a certificate password in this policy, we recommend using a named value.

Examples

Client certificate identified by the certificate ID

<authentication-certificatecertificate-id="544fe9ddf3b8f30fb490d90f" /> 

Client certificate identified by thumbprint

<authentication-certificatethumbprint="CA06F56B258B7A0D4F2B05470939478651151984" />

Client certificate set in the policy rather than retrieved from the built-in certificate store

<authentication-certificatebody="@(context.Variables.GetValueOrDefault<byte[]>("byteCertificate"))"password="optional-certificate-password" />

Related policies

[!INCLUDE api-management-policy-ref-next-steps]

close