Skip to content

Commit b32f845

Browse files
Merge pull request #13393 from MicrosoftDocs/main
Auto Publish – main to live - 2026-06-04 17:30 UTC
2 parents 66de1da + a9f9dc9 commit b32f845

6 files changed

Lines changed: 50 additions & 40 deletions

File tree

docs/agent-id/how-to-validate-agent-tokens-downstream-api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ The following diagram shows how tokens flow from the agent through the sidecar t
5757

5858
:::image type="content" source="media/how-to-validate-agent-tokens-downstream-api/agent-token-flow-to-downstream-api.png" alt-text="Diagram showing the agent caller sending a Bearer token to the weather API, which verifies the token and calls Open-Meteo." lightbox="media/how-to-validate-agent-tokens-downstream-api/agent-token-flow-to-downstream-api.png":::
5959

60-
TR is the agent identity token issued by Microsoft Entra ID through the sidecar. It contains the claims your API validates, including the `xms_par_app_azp` agent identity marker. For a detailed breakdown of all tokens in the flow, see [Run the sidecar for local development](sidecar-local-development.md#understand-the-token-flow).
60+
The agent identity token, TR, is issued by Microsoft Entra ID through the sidecar. It contains the claims your API validates, including the `xms_par_app_azp` agent identity marker. For a detailed breakdown of all tokens in the flow, see [Run the sidecar for local development](sidecar-local-development.md#understand-the-token-flow).
6161

6262
Token validation libraries differ across ecosystems (Python, Node.js, .NET). This sample uses PyJWT with the `cryptography` backend for RS256 signature verification. When you build your own downstream API, choose the equivalent JWT validation library for your technology stack.
6363

docs/agent-id/integrate-aws-bedrock-agent.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ Run the following commands once per tenant to create the Blueprint app, Agent ID
126126
- **`AGENT_CLIENT_ID`:** The Agent ID created from the Blueprint.
127127

128128
1. (Optional) Create the SPA app and configure OBO. This step is required only if you want to use the OBO identity flow:
129+
130+
Run the following scripts to create the SPA app registration and configure OBO permissions on the Blueprint. The scripts register the SPA redirect URI and grant the required delegated permissions.
129131

130132
**Bash:**
131133

@@ -156,7 +158,7 @@ The sidecar supports multiple credential types through the `AzureAd__ClientCrede
156158
- **`KeyVault`:** Certificate from Azure Key Vault.
157159
- **`StoreWithThumbprint`:** Certificate from local machine store.
158160

159-
1. Copy the environment template and open it in your editor:
161+
1. Create a local `.env` configuration file from the included template. This file stores your tenant, app, and AWS credentials:
160162

161163
**Bash:**
162164

@@ -191,13 +193,15 @@ The sidecar supports multiple credential types through the `AzureAd__ClientCrede
191193
192194
## Start the stack
193195

194-
1. Make sure Docker is running and then start all containers:
196+
1. Verify that Docker Desktop (or Docker Engine) is running on your machine.
197+
198+
1. Build the container images and start all three services (agent, sidecar, and weather API) in detached mode:
195199

196200
```bash
197201
docker compose up --build -d
198202
```
199203

200-
1. Verify the stack is ready:
204+
1. Check that all containers started successfully by querying the status endpoint. The response reports whether the agent can reach AWS Bedrock:
201205

202206
**Bash:**
203207

@@ -245,28 +249,28 @@ If something isn't working as expected, check the following table for common iss
245249
| OBO sign-in popup blocked | Browser popup blocker. | Allow popups for `localhost:3001`. |
246250
| `4xx` from sidecar during OBO | `CLIENT_SPA_APP_ID` missing or SPA redirect URI mismatch. | Rerun `setup-obo-client-app`. Ensure `http://localhost:3001` is on the SPA's redirect URIs. |
247251

248-
View container logs for debugging:
252+
If an issue persists even after following the troubleshooting steps, inspect the container logs directly. Each service logs to its own container:
249253

250254
```bash
251-
docker logs llm-agent-aws
252-
docker logs agent-id-sidecar-aws
253-
docker logs weather-api-aws
255+
docker logs llm-agent-aws # Agent app: Bedrock calls, tool invocations
256+
docker logs agent-id-sidecar-aws # Sidecar: token acquisition, credential errors
257+
docker logs weather-api-aws # Weather API: JWT validation, request handling
254258
```
255-
256259
## Clean up resources
257260

258-
Stop and remove the containers when you're done:
261+
When you finish testing, stop the local containers to free system resources. Choose one of the following cleanup options based on whether you want to keep images for faster restarts.
262+
263+
> [!IMPORTANT]
264+
> `docker compose down` removes only the local Docker containers. Microsoft Entra objects (agent blueprint, Agent ID, SPA app registration) are tenant-side state and persist. Delete them manually in the Microsoft Entra admin center if you no longer need them.
259265
260266
```bash
261-
# Stop containers but keep volumes and images
267+
# Stop containers but keep volumes and images for faster restarts
262268
docker compose down
263269

264270
# Remove everything including volumes and images
265271
docker compose down -v --rmi all
266272
```
267273

268-
The Entra objects (agent blueprint, Agent ID, SPA app registration) are tenant-side state, so using `docker compose down` won't remove them. Remove them manually in the Microsoft Entra admin center if no longer needed.
269-
270274
## Related content
271275

272276
- [Authentication with Microsoft Entra Auth SDK (sidecar)](authentication-with-auth-sdk-sidecar.md)

docs/agent-id/interactive-agent-authentication-authorization-flow.md

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@ ms.author: dmwendia
77
ms.topic: how-to
88
ms.date: 03/17/2026
99
ms.reviewer: dastrock, jomondi
10+
ai-usage: ai-assisted
1011

1112
#customer-intent: As a developer building interactive agents, I want to authenticate users, configure authorization, and acquire tokens through the On-Behalf-Of flow, so that my agent can securely act on behalf of users to access protected resources.
1213
---
1314

1415
# Authenticate users and acquire tokens for interactive agents
1516

16-
Interactive agents take actions on behalf of users. To do so securely, the agent must authenticate the user, obtain consent for the required permissions, and acquire access tokens for downstream APIs. This article walks you through implementing the end-to-end flow for your interactive agent:
17+
Interactive agents take actions on behalf of users. To act on behalf of users securely, the agent authenticates the user, gets consent for required permissions, and acquires access tokens for downstream APIs. This article walks you through the end-to-end authentication and token acquisition flow for your interactive agent:
1718

1819
1. Register a redirect URI for your agent identity blueprint.
1920
1. Configure user or admin authorization (consent).
@@ -32,6 +33,7 @@ Before you begin, ensure you have:
3233
- An [agent identity](create-delete-agent-identities.md).
3334
- A client application registered in Microsoft Entra to handle user authentication.
3435
- Familiarity with the [OAuth 2.0 authorization code flow](/entra/identity-platform/v2-oauth2-auth-code-flow).
36+
- The ability to run an ASP.NET Core web API if you plan to use the token validation and OBO samples in this article.
3537

3638
For admin authorization, you also need:
3739

@@ -41,9 +43,9 @@ For admin authorization, you also need:
4143

4244
To support delegated permissions, your agent identity blueprint must be configured with a valid redirect URI. This URI is where Microsoft Entra ID sends users after they grant or deny consent to your agent.
4345

44-
### [Microsoft Graph API](#tab/microsoft-graph-api)
46+
### [Use Microsoft Graph API](#tab/microsoft-graph-api)
4547

46-
To send this request, you first need to obtain an access token with the delegated permission `AgentIdentityBlueprint.ReadWrite.All`.
48+
To update the redirect URI on the agent identity blueprint, you first need to obtain an access token with the delegated permission `AgentIdentityBlueprint.ReadWrite.All`. Then send a PATCH request to the application object for the agent identity blueprint:
4749

4850
```http
4951
PATCH https://graph.microsoft.com/beta/applications/<agent-blueprint-id>
@@ -60,7 +62,9 @@ Authorization: Bearer <token>
6062
}
6163
```
6264

63-
### [Microsoft Graph PowerShell](#tab/microsoft-graph-powershell)
65+
### [Use Microsoft Graph PowerShell](#tab/microsoft-graph-powershell)
66+
67+
Use Microsoft Graph PowerShell to update the redirect URI on the agent identity blueprint.
6468

6569
```powershell
6670
Connect-MgGraph -Scopes "AgentIdentityBlueprint.ReadWrite.All" -TenantId <your-test-tenant>
@@ -86,14 +90,14 @@ Invoke-MgGraphRequest -Method PATCH `
8690

8791
## Configure user authorization
8892

89-
Before the agent can act on behalf of a user, the user must consent to the required permissions. This consent step doesn't return a token. Instead, it records that the user has granted the agent permission to act on their behalf. Token acquisition happens in a [later step](#authenticate-the-user-and-request-a-token).
90-
91-
To prompt a user for consent, construct an authorization URL and redirect the user to it. The agent can present this URL in different ways, for example, as a link in a chat message.
93+
Before the agent can act on behalf of a user, the user must consent to the required permissions. The user consent request doesn't return a token. Instead, it records that the user granted the agent permission to act on their behalf. Token acquisition happens in [Authenticate the user and request a token](#authenticate-the-user-and-request-a-token).
9294

9395
> [!IMPORTANT]
9496
> Use the **agent identity** client ID in the `client_id` parameter, not the agent identity blueprint ID.
9597
96-
```http
98+
To prompt a user for consent, construct an authorization URL and redirect the user to it. The agent can present this URL in different ways, for example, as a link in a chat message.
99+
100+
```text
97101
https://login.microsoftonline.com/contoso.onmicrosoft.com/oauth2/v2.0/authorize?
98102
client_id=<agent-identity-id>
99103
&response_type=none
@@ -103,37 +107,37 @@ https://login.microsoftonline.com/contoso.onmicrosoft.com/oauth2/v2.0/authorize?
103107
&state=xyz123
104108
```
105109

106-
When the user opens this URL, Microsoft Entra ID prompts them to sign in and grant consent to the permissions specified in the `scope` parameter. After consent is granted, the user is redirected to the specified redirect URI.
110+
When the user opens this URL, Microsoft Entra ID prompts them to sign in and grant consent. After consent, the user is sent back to the redirect URI.
107111

108-
The key parameters in the consent URL are:
112+
The key parameters in the user consent authorization URL are:
109113

110114
- `client_id`: The agent identity client ID (not the agent identity blueprint client ID).
111-
- `response_type`: Set to `none` because this request records consent only. Token acquisition uses `response_type=code` in a [separate request](#authenticate-the-user-and-request-a-token).
112-
- `redirect_uri`: Must match exactly what you configured in the previous step.
115+
- `response_type`: Set to `none` because this request records consent only. Token acquisition uses `response_type=code` in [Authenticate the user and request a token](#authenticate-the-user-and-request-a-token).
116+
- `redirect_uri`: Must match exactly the redirect URI configured on the agent identity blueprint.
113117
- `scope`: Specify the delegated permissions you need (for example, `User.Read`).
114118
- `state`: Optional parameter for maintaining state between the request and callback.
115119

116120
For more information on OAuth authorization concepts, see [Permissions and consent in the Microsoft identity platform](/entra/identity-platform/permissions-consent-overview).
117121

118122
## Configure admin authorization
119123

120-
Agents can also request authorization from a Microsoft Entra ID administrator, who can grant authorization to the agent for all users in their tenant. Application permissions require admin authorization because individual users can't consent to them.
124+
An administrator in Microsoft Entra ID can grant consent to the agent for all users in the tenant. Use admin consent when you need application permissions, because individual users can't consent to them.
121125

122-
To grant admin consent, construct the authorization URL that prompts the administrator. Use the agent identity ID in the following request.
126+
To grant tenant-wide admin consent, direct an administrator to the following URL. Use the agent identity ID in the `client_id` parameter.
123127

124-
```http
128+
```text
125129
https://login.microsoftonline.com/contoso.onmicrosoft.com/v2.0/adminconsent
126130
?client_id=<agent-identity-id>
127131
&scope=User.Read
128132
&redirect_uri=https://entra.microsoft.com/TokenAuthorize
129133
&state=xyz123
130134
```
131135

132-
After the administrator grants consent, the permissions are applied tenant-wide and users in that tenant don't need to individually consent to those permissions.
136+
After the administrator grants consent, the permissions apply to the whole tenant. Users don't need to consent again.
133137

134138
## Authenticate the user and request a token
135139

136-
After authorization is configured, the client app (such as a frontend or mobile app) initiates an OAuth 2.0 authorization code request to obtain a token where the audience is the agent identity blueprint. In this step, `client_id` refers to the client app's own registered application ID, not the agent identity or agent identity blueprint ID.
140+
After authorization is configured, the client app (such as a frontend or mobile app) starts an OAuth 2.0 authorization code request. The token audience is the agent identity blueprint. In the authorization code request, `client_id` refers to the client app's own registered application ID, not the agent identity or agent identity blueprint ID.
137141

138142
1. Redirect the user to the Microsoft Entra ID authorization endpoint with the following parameters:
139143

@@ -146,7 +150,7 @@ After authorization is configured, the client app (such as a frontend or mobile
146150
&state=abc123
147151
```
148152
149-
1. After the user signs in, your app receives an authorization code at the redirect URI. Exchange it for an access token:
153+
1. After the user signs in, your app receives an authorization code at the redirect URI. Exchange the authorization code for an access token:
150154
151155
```http
152156
POST https://login.microsoftonline.com/<my-test-tenant>/oauth2/v2.0/token
@@ -166,7 +170,7 @@ After authorization is configured, the client app (such as a frontend or mobile
166170
167171
## Validate the access token
168172
169-
The agent, typically exposed via a web API, must validate the access token. Always use an approved library to perform token validation. Never implement your own token validation code.
173+
The web API must validate the incoming access token before the agent can act. Always use an approved library to validate tokens. Don't write your own token validation code.
170174
171175
1. Install the `Microsoft.Identity.Web` NuGet package:
172176
@@ -214,7 +218,7 @@ For more information about Microsoft.Identity.Web, see [Microsoft.Identity.Web d
214218
215219
## Validate user claims
216220
217-
After you validate the access token, the agent can identify the user and perform authorization checks. This example API route extracts user claims from the access token and returns them in the API response:
221+
After access token validation, the agent can identify the user and perform authorization checks. The following example API route extracts user claims from the access token and returns them in the API response:
218222
219223
```csharp
220224
app.MapGet("/hello-agent", (HttpContext httpContext) =>
@@ -238,7 +242,7 @@ After an interactive agent validates the user's token, it can request access tok
238242
- Exchange it for a new access token for a downstream API like Microsoft Graph.
239243
- Use that new token to access protected resources on behalf of the original user.
240244

241-
### [Microsoft Identity Web](#tab/identity-web-tokens)
245+
### [Use Microsoft Identity Web](#tab/identity-web-tokens)
242246

243247
The `Microsoft.Identity.Web` library simplifies the OBO implementation by handling token exchange automatically, so you don't have to manually implement the flow by following the protocol.
244248

@@ -274,7 +278,7 @@ The `Microsoft.Identity.Web` library simplifies the OBO implementation by handli
274278
app.Run();
275279
```
276280

277-
1. In the agent API, exchange the incoming access token for a new access token for the agent identity. `Microsoft.Identity.Web` validates the incoming access token and handles the on-behalf-of token exchange:
281+
1. In the agent API, exchange the incoming user access token for a new access token for the agent identity. `Microsoft.Identity.Web` validates the incoming access token and handles the on-behalf-of token exchange:
278282

279283
```csharp
280284
app.MapGet("/agent-obo-user", async (HttpContext httpContext) =>
@@ -291,7 +295,7 @@ The `Microsoft.Identity.Web` library simplifies the OBO implementation by handli
291295
.RequireAuthorization();
292296
```
293297
294-
### [Microsoft Graph SDK](#tab/graph-sdk-tokens)
298+
### [Use Microsoft Graph SDK](#tab/graph-sdk-tokens)
295299
296300
If you're using the Microsoft Graph SDK, you can authenticate to Microsoft Graph using the `GraphServiceClient`.
297301
@@ -351,6 +355,8 @@ Under the hood, the OBO flow involves two token exchanges: first, the agent iden
351355
352356
## Related content
353357
358+
Learn more about agent tokens and related APIs:
359+
354360
- [Token claims reference](agent-token-claims.md)
355361
- [On-behalf-of flow in agents](agent-on-behalf-of-oauth-flow.md)
356362
- [Call Microsoft Graph API](call-api-microsoft-graph.md)

docs/id-governance/entitlement-management-access-package-assignments.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ In some cases, you might want to directly assign specific identities to an acces
113113
> [!NOTE]
114114
> Access package assignment managers will no longer be able to bypass approval settings if the policy requires approval. This means identities can't be directly assigned to the package without necessary approval(s) from the designated approver(s). In the case that you need to bypass approval, we recommend creating a second policy on the access package that does not require approval and is scoped only to identities who need access.
115115
116-
## Directly assign any identity (Preview)
116+
## Directly assign any identity
117117

118118
Entitlement management also allows you to directly assign external identities to an access package to make collaborating with partners easier. To do this, the access package must have a policy that allows identities not yet in your directory to request access.
119119

@@ -130,7 +130,7 @@ Entitlement management also allows you to directly assign external identities to
130130

131131
1. In the **Select policy** list, select a policy that allows that is set to **For users not in your directory**
132132

133-
1. Select **External user (Preview)**. You're able to specify which users you want to assign to this access package.
133+
1. Select **External user**. You're able to specify which users you want to assign to this access package.
134134
![Assignments - Add any user to access package](./media/entitlement-management-access-package-assignments/assignments-add-any-user.png)
135135

136136
1. Enter the identity **Name** (optional) and the identity **Email address** (required).
29.8 KB
Loading

0 commit comments

Comments
 (0)