Skip to content

Commit cdc4b74

Browse files
author
gitName
committed
review comments
1 parent 8259327 commit cdc4b74

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

articles/api-management/validate-azure-ad-token-policy.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: dlepow
66

77
ms.service: azure-api-management
88
ms.topic: article
9-
ms.date: 07/23/2024
9+
ms.date: 01/29/2025
1010
ms.author: danlep
1111
---
1212

@@ -17,7 +17,7 @@ ms.author: danlep
1717
The `validate-azure-ad-token` policy enforces the existence and validity of a JSON web token (JWT) that was provided by the Microsoft Entra (formerly called Azure Active Directory) service for a specified set of principals in the directory. The JWT can be extracted from a specified HTTP header, query parameter, or value provided using a policy expression or context variable.
1818

1919
> [!NOTE]
20-
> To validate a JWT that was provided by an identity provider other than Microsoft Entra, API Management also provides the generic [`validate-jwt`](validate-jwt-policy.md) policy.
20+
> Use the generic [`validate-jwt`](validate-jwt-policy.md) policy to validate a JWT that was provided by an identity provider other than Microsoft Entra.
2121
2222
[!INCLUDE [api-management-policy-generic-alert](../../includes/api-management-policy-generic-alert.md)]
2323

@@ -109,7 +109,7 @@ The `validate-azure-ad-token` policy enforces the existence and validity of a JS
109109

110110
### Simple token validation
111111

112-
The following policy is the minimal form of the `validate-azure-ad-token` policy. It expects the JWT to be provided in the default `Authorization` header using the `Bearer` scheme. In this example, the Microsoft Entra tenant ID and client application ID are provided using named values.
112+
The following policy is the minimal form of the `validate-azure-ad-token` policy. It expects the JWT to be provided in the default `Authorization` header using the `Bearer` scheme. In this example, the Microsoft Entra tenant ID and client application ID are provided using named values.
113113

114114
```xml
115115
<validate-azure-ad-token tenant-id="{{aad-tenant-id}}">
@@ -119,6 +119,21 @@ The following policy is the minimal form of the `validate-azure-ad-token` policy
119119
</validate-azure-ad-token>
120120
```
121121

122+
### Token validation using decryption key
123+
124+
This example shows how to use the `validate-azure-ad-token` policy to validate a token that is decrypted using a decryption key. The Microsoft Entra tenant ID and client application ID are provided using named values. The key is specified using the ID of an uploaded certificate (in PFX format) that contains the public key.
125+
126+
```xml
127+
<validate-azure-ad-token tenant-id="{{aad-tenant-id}}">
128+
<client-application-ids>
129+
<application-id>{{aad-client-application-id}}</application-id>
130+
</client-application-ids>
131+
<decryption-keys>
132+
<key certificate-id="mycertificate"/>
133+
</decryption-keys>
134+
</validate-azure-ad-token>
135+
```
136+
122137
### Validate that audience and claim are correct
123138

124139
The following policy checks that the audience is the hostname of the API Management instance and that the `ctry` claim is `US`. The Microsoft tenant ID is the well-known `organizations` tenant, which allows tokens from accounts in any organizational directory. The hostname is provided using a policy expression, and the client application ID is provided using a named value. The decoded JWT is provided in the `jwt` variable after validation.

articles/api-management/validate-jwt-policy.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ ms.author: danlep
1717
The `validate-jwt` policy enforces existence and validity of a supported JSON web token (JWT) that was provided by an identity provider. The JWT can be extracted from a specified HTTP header, extracted from a specified query parameter, or matching a specific value.
1818

1919
> [!NOTE]
20-
> To validate a JWT that was provided specifically by the Microsoft Entra service, API Management also provides the [`validate-azure-ad-token`](validate-azure-ad-token-policy.md) policy.
20+
> Use the [`validate-azure-ad-token`](validate-azure-ad-token-policy.md) policy to validate a JWT that was provided by Microsoft Entra.
2121
2222
[!INCLUDE [api-management-policy-form-alert](../../includes/api-management-policy-form-alert.md)]
2323

0 commit comments

Comments
 (0)