You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -5,7 +5,7 @@ description: Learn how to configure JSON Web Token (JWT) validation in Azure App
5
5
author: rnautiyal
6
6
ms.author: rnautiyal
7
7
ms.service: azure-application-gateway
8
-
ms.topic: conceptual
8
+
ms.topic: article
9
9
ms.date: 11/18/2025
10
10
---
11
11
@@ -39,27 +39,18 @@ By performing token validation at the edge, Application Gateway simplifies appli
39
39
-**Network Requirements**
40
40
- Outbound Connectivity from Application Gateway Subnet to login.microsoftonline.com over TCP port 443
41
41
42
+
42
43
-**Microsoft Entra ID Requirements**
43
-
- Register your Web API in Microsoft Entra ID and note down:
44
-
- Tenant ID: Azure AD tenant GUID, or use common, organizations, or consumers for multitenant apps
45
-
- Client ID: The Application (Client) ID from your app registration (must be a GUID)
46
-
- Audiences (optional): Additional valid aud claim values (max 5) such as custom App ID URIs
44
+
- Register your Web API in Microsoft Entra ID
45
+
- Make a call to the Microsoft Entra ID to request access to a service. The Microsoft Entra ID responds with an access token.
47
46
48
-
> [!NOTE]
49
-
> Audiences (`aud`): The `aud` claim is the resource identifier (App ID URI, well‑known resource URI, or sometimes the app's Client ID GUID). The `aud` claim identifies the resource (API) the token is issued for — an App ID URI, a well‑known resource URI, or the application's Client ID GUID. The scope or resource you request points to a resource; Entra ID then sets `aud` to that resource's identifier.
50
-
> Common mappings:
51
-
>
52
-
> -`--scope "api://<ClientID>/.default"` → `aud` = your App ID URI (for example. `api://<ClientID>` or custom). If no App ID URI is set, `aud` falls back to the Client ID GUID.
> Add entries to **Audiences** when the token's `aud` is a custom App ID URI (not equal to the bare Client ID GUID) or you intentionally accept multiple resource identifiers. The gateway succeeds validation if `aud` matches either:
57
-
> (1) the configured Client ID (when `aud` is the GUID), or
58
-
> (2) any value in the Audiences list (including App ID URIs or well‑known resource URIs).
47
+
-**Configure JWT validation in Application Gateway**
48
+
49
+
59
50
60
-
## Configure JWT validation
51
+
## JSON Web Token (JWT) validation setup
61
52
62
-
In this section, you learn how to configure JWT validation in Azure Application Gateway in four steps:
53
+
In this section, you learn how to configure JWT validation in Azure Application Gateway:
63
54
64
55
## Register an application in Microsoft Entra ID
65
56
@@ -83,7 +74,6 @@ In this section, you learn how to configure JWT validation in Azure Application
83
74
84
75
> [!NOTE]
85
76
> Supported account types:
86
-
>
87
77
> Single tenant (This directory only)
88
78
>
89
79
> Multitenant (Any Azure AD directory)
@@ -126,19 +116,16 @@ In this section, you learn how to configure JWT validation in Azure Application
126
116
127
117
1. Link this rule to your JWT validation configuration. Your JWT validation configuration is now attached to a secure HTTPS listener and routing rule.
128
118
129
-
## Send Request to Application Gateway
130
119
131
-
Use `curl` or any HTTP client to send requests with a valid JWT in the `Authorization` header.
120
+
## Send a JWT Access Token with Every Request to the Secure Application
To securely access an application protected by Application Gateway, the client must first obtain a JWT access token from the Microsoft Entra ID token endpoint. The client then includes this token in the Authorization header (for example, Authorization: Bearer TOKEN) on every request it sends to the Application Gateway. Application Gateway validates the token before forwarding the request to the backend application, ensuring that only authenticated and authorized traffic reaches the secure application.
137
123
138
-
> [!NOTE]
139
-
> Tokens must be issued by Microsoft Entra ID. Check [Token](/azure/devops/cli/entra-tokens) for more details
124
+
- Learn more about [Access tokens in the Microsoft identity platform](/entra/identity-platform/access-tokens)
Check ``x-msft-entra-identity`` header to confirm authentication.
139
+
Check ``x-msft-entra-identity`` header to confirm authentication.
153
140
154
141
## Troubleshooting 401 and 403 responses
155
142
@@ -168,127 +155,7 @@ If requests return **401** or **403**, verify:
168
155
- Acquire a new token for the correct audience.
169
156
- Check Application Gateway access logs for detailed failure reason.
170
157
171
-
## Additional concepts for reference
172
-
173
-
## Audience vs. scope mapping
174
-
175
-
Understanding how requested scopes map to the JWT `aud` claim helps determine whether you need to populate the optional **Audiences** list in the Application Gateway configuration.
176
-
177
-
**Key points:**
178
158
179
-
-`aud` represents the resource the token was issued for.
180
-
- Resource identifiers can be:
181
-
- An App ID URI (for example, `api://<ClientID>` or a verified domain URI like `https://api.contoso.com`)
182
-
- A well-known Microsoft resource URI (for example, `https://management.azure.com`, `https://graph.microsoft.com`)
183
-
- The application's Client ID GUID (common when no App ID URI is set)
184
-
185
-
## Common scope-to-`aud` mappings
186
-
187
-
| az CLI scope argument | Typical resulting `aud`|
0 commit comments