Skip to content

Commit a3f1302

Browse files
Learn Build Service GitHub AppLearn Build Service GitHub App
authored andcommitted
Merging changes synced from https://github.com/MicrosoftDocs/entra-docs-pr (branch live)
2 parents 2558884 + d735aa8 commit a3f1302

10 files changed

Lines changed: 197 additions & 97 deletions

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

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@ title: Authenticate and acquire tokens for autonomous agents
33
description: Learn how to authenticate autonomous agents with Microsoft Entra ID, grant application permissions, and optionally create and authenticate as an agent's user account.
44
titleSuffix: Microsoft Entra Agent ID
55
ms.topic: how-to
6-
ms.date: 03/30/2026
6+
ms.date: 06/15/2026
77
ms.reviewer: jomondi, dastrock
88

99
#customer-intent: As a developer building autonomous agents, I want to authenticate my agent, grant it application permissions, and optionally create an agent's user account, so that my agent can operate independently and access Microsoft Graph and other resources.
10+
ai-usage: ai-assisted
11+
ms.custom: msecd-doc-authoring-1013
1012
---
1113

1214
# Authenticate and acquire tokens for autonomous agents
@@ -55,7 +57,7 @@ Gather the credential you configured on your agent identity blueprint. You need
5557

5658
### [Microsoft.Identity.Web](#tab/microsoft-identity-web)
5759

58-
For production, use a managed identity as a federated identity credential:
60+
Configure *Microsoft.Identity.Web* to authenticate your agent identity blueprint using a federated identity credential. For production, use a managed identity as the federated identity credential:
5961

6062
```json
6163
{
@@ -101,6 +103,8 @@ When using a client secret during local development, provide the `client_secret`
101103

102104
### [Microsoft Graph API](#tab/Microsoft-graph-api)
103105

106+
Use the following token request to obtain a token for the agent identity blueprint:
107+
104108
```http
105109
POST https://login.microsoftonline.com/<my-test-tenant>/oauth2/v2.0/token
106110
Content-Type: application/x-www-form-urlencoded
@@ -197,15 +201,15 @@ There are two ways to grant application permissions to an autonomous agent:
197201

198202
Use the following steps to get an app role assignment.
199203

200-
1. [Obtain an access token](#request-an-agent-identity-token) with the application permissions `Application.Read.All` and `AppRoleAssignment.ReadWrite.All`.
204+
1. [Request an agent identity token](#request-an-agent-identity-token) with the application permissions `Application.Read.All` and `AppRoleAssignment.ReadWrite.All`.
201205

202206
1. Get the object ID of the resource service principal that you're trying to access. For example, to find the Microsoft Graph service principal object ID:
203207
1. Go to the [Microsoft Entra admin center](https://entra.microsoft.com/).
204208
1. Navigate to **Entra ID** --> **Enterprise Applications**
205209
1. Filter by Application type == Microsoft Applications
206210
1. Search for **Microsoft Graph**.
207211

208-
1. Get the unique ID of the [app role you want to assign](/graph/permissions-reference).
212+
1. Get the unique ID of the app role you want to assign from the [Microsoft Graph permissions reference](/graph/permissions-reference).
209213

210214
1. Create the app role assignment:
211215

@@ -267,7 +271,7 @@ Agent implementations might redirect the admin to this URL in various ways, such
267271
> [!NOTE]
268272
> Configure a redirect URI on your blueprint and include a `state` parameter in the consent request. When consent is granted, the user is sent to the redirect URI where you can display confirmation. Your endpoint can use the `state` parameter to track that permission was granted. For single-tenant agents, you can alternatively retry token requests until consent is granted because the tenant ID is already known.
269273
270-
After you grant your application the required permissions, request a new agent access token for the permissions to take effect.
274+
After you grant your agent identity blueprint the required permissions, request a new agent access token for the permissions to take effect.
271275

272276
## Authenticate as an agent's user account
273277

@@ -279,14 +283,14 @@ Each agent identity can only have a single associated agent's user account, and
279283

280284
To create agents' user accounts, your agent identity blueprint must be granted the application permission `AgentIdUser.ReadWrite.IdentityParentedBy` in the tenant. You can obtain authorization in one of two ways:
281285

282-
- [Request agent authorization](#request-authorization-from-a-tenant-administrator). Be sure to use your agent identity blueprint as the `client_id`, not the agent identity.
283-
- [Manually create an appRoleAssignment](#create-an-app-role-assignment-via-apis) in the tenant. Use the service principal object ID of the agent identity blueprint as the `principalId` value, not its application (client) ID.
286+
- [Request authorization from a tenant administrator](#request-authorization-from-a-tenant-administrator). Be sure to use your agent identity blueprint as the `client_id`, not the agent identity.
287+
- [Create an app role assignment via APIs](#create-an-app-role-assignment-via-apis) in the tenant. Use the service principal object ID of the agent identity blueprint as the `principalId` value, not its application (client) ID.
284288

285289
If you wish to use a different client, not the agent identity blueprint, to create agents' user accounts, that client needs to obtain the `AgentIdUser.ReadWrite.All` delegated or application permission instead.
286290

287291
### Create an agent's user account
288292

289-
Create an agent's user account using your agent identity blueprint or other approved client. The recommended way to create an agent's user account is using your agent identity blueprint. You [require an access token](create-delete-agent-identities.md#get-an-access-token-using-agent-identity-blueprint) to create an agent's user account.
293+
Create an agent's user account using your agent identity blueprint or other approved client. The recommended way to create an agent's user account is using your agent identity blueprint. You need to [get an access token using the agent identity blueprint](create-delete-agent-identities.md#get-an-access-token-using-agent-identity-blueprint) to create an agent's user account.
290294

291295
#### [REST](#tab/rest)
292296

@@ -409,7 +413,7 @@ Once you have your agent's user account created, you don't need to configure any
409413

410414
### Grant consent to agent identity
411415

412-
Agents' user accounts behave like any other user account. Before you can request tokens using your agent's user account, you need to authorize the agent identity to act on its behalf. You can authorize the agent identity using [admin authorization](#request-authorization-from-a-tenant-administrator) or manually create an `oAuth2PermissionGrant` using Microsoft Graph or Microsoft Graph PowerShell.
416+
Agents' user accounts behave like any other user account. Before you can request tokens using your agent's user account, you need to authorize the agent identity to act on its behalf. You can authorize the agent identity by [requesting authorization from a tenant administrator](#request-authorization-from-a-tenant-administrator) or manually create an `oAuth2PermissionGrant` using Microsoft Graph or Microsoft Graph PowerShell.
413417

414418
For Microsoft Graph, your request is as shown in the following snippet:
415419

@@ -458,7 +462,7 @@ To authenticate an agent's user account, you need to follow a three-step process
458462

459463
#### [REST](#tab/rest)
460464

461-
First, request a token as the agent identity blueprint, as described in [Request a token for the agent identity blueprint](#request-a-token-for-the-agent-identity-blueprint). Once you have your agent app token, use it to request a Federated Identity Credential (FIC) for your agent identity:
465+
First, request a token as the agent identity blueprint, as described in [Request a token for the agent identity blueprint](#request-a-token-for-the-agent-identity-blueprint). Once you have the agent identity blueprint token, use the agent identity blueprint token to request a Federated Identity Credential (FIC) for your agent identity:
462466

463467
```http
464468
POST https://login.microsoftonline.com/<my-test-tenant>/oauth2/v2.0/token

docs/agent-id/integrate-n8n-agent.md

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@ titleSuffix: Microsoft Entra Agent ID
44
description: Deploy n8n on Azure Container Apps and secure AI agent workflows with Microsoft Entra Agent ID and Microsoft Graph MCP Server for Enterprise.
55
ms.service: entra
66
ms.topic: how-to
7-
ms.date: 04/30/2026
7+
ms.date: 06/15/2026
8+
author: Dickson-Mwendia
9+
ms.author: dmwendia
810
ms.reviewer: astaykov
9-
ms.custom: agent-id, msecd-doc-authoring-1012
11+
ms.custom: agent-id, msecd-doc-authoring-1013
12+
ai-usage: ai-assisted
1013

1114
#customer intent: As a developer or IT admin, I want to secure n8n workflows with Microsoft Entra Agent ID so that my n8n agents can access Microsoft Graph and MCP Server for Enterprise using agent identities.
1215

@@ -16,7 +19,7 @@ ms.custom: agent-id, msecd-doc-authoring-1012
1619

1720
This guide shows how to deploy [n8n](https://n8n.io/) on Azure Container Apps with Microsoft Entra Agent ID integration. The deployment uses the Azure Developer CLI (`azd`) to provision infrastructure, create Microsoft Entra identity objects, and configure n8n workflows automatically.
1821

19-
Unlike the [sidecar pattern](authentication-with-auth-sdk-sidecar.md) used for custom agents, this integration uses the [n8n-nodes-entraagentid](https://www.npmjs.com/package/@astaykov/n8n-nodes-entraagentid) community node to manage token acquisition directly within n8n workflows. The deployed workflows demonstrate both autonomous (app-only) and on-behalf-of (OBO) token flows, with access to Microsoft Graph and the Microsoft Graph MCP Server for Enterprise, `https://mcp.svc.cloud.microsoft/enterprise`.
22+
Unlike the [Authentication with Microsoft Entra Auth SDK sidecar](authentication-with-auth-sdk-sidecar.md) pattern used for custom agents, the n8n integration uses the [n8n-nodes-entraagentid](https://www.npmjs.com/package/@astaykov/n8n-nodes-entraagentid) community node to manage token acquisition directly within n8n workflows. The deployed workflows demonstrate both autonomous (app-only) and on-behalf-of (OBO) token flows, with access to Microsoft Graph and the Microsoft Graph MCP Server for Enterprise, `https://mcp.svc.cloud.microsoft/enterprise`.
2023

2124
> [!NOTE]
2225
> This sample demonstrates the use of the `n8n-nodes-entraagentid` community node within n8n. It isn't guidance for deploying n8n on Azure in production.
@@ -38,7 +41,7 @@ If you're running locally instead of Cloud Shell, install these tools before pro
3841
- [Microsoft.Entra PowerShell module](/powershell/entra-powershell/) v1.2 or later.
3942
- Git.
4043

41-
Sign in to Azure CLI and Azure Developer CLI before running the deployment:
44+
Authenticate both the Azure CLI and Azure Developer CLI so that the deployment commands can create and manage resources in your subscription:
4245

4346
```bash
4447
az login
@@ -67,7 +70,7 @@ The entire deployment runs through a single `azd up` command that provisions Azu
6770
- **n8n admin email:** Email for the n8n owner account.
6871
- **n8n admin password:** Password for the n8n owner account (minimum 8 characters, mixed case, number).
6972

70-
1. During the postprovision phase, the automation performs a second sign-in. A device code is displayed. Open the URL and enter the code. This step requires the Global Administrator or Application Administrator role. The postprovision hook then:
73+
1. During the postprovision phase, the automation performs a second sign-in. A device code is displayed. Open the URL and enter the code. This step requires the Global Administrator or Application Administrator role. The `azd up` postprovision hook then:
7174

7275
- Creates Microsoft Entra Agent ID objects (Blueprint, Agent Identity, Agent User).
7376
- Enables the Microsoft Graph MCP Server for Enterprise.
@@ -82,7 +85,10 @@ When the deployment completes, the script prints your n8n URL and a summary of w
8285

8386
## Explore the deployed resources
8487

85-
### Azure infrastructure
88+
The deployment creates Azure resources, Microsoft Entra identity objects, and n8n configuration assets that work together to support the sample workflows.
89+
90+
<a name="azure-infrastructure"></a>
91+
### Review the Azure infrastructure resources
8692

8793
The deployment creates the following Azure resources:
8894

@@ -94,7 +100,8 @@ The deployment creates the following Azure resources:
94100
- **Azure OpenAI:** GPT model deployment used by the AI agent workflows.
95101
- **Log Analytics Workspace:** Diagnostics and monitoring.
96102

97-
### Microsoft Entra identity objects
103+
<a name="microsoft-entra-identity-objects"></a>
104+
### Review the Microsoft Entra identity objects
98105

99106
The automation creates these objects once and reuses them on subsequent runs:
100107

@@ -103,7 +110,8 @@ The automation creates these objects once and reuses them on subsequent runs:
103110
- **Agent user account:** A cloud-only user identity that enables delegated (OBO) token flows.
104111
- **Single page app (SPA) app registration:** Client app for the webhook demo, preconfigured with redirect URIs and Blueprint API permissions.
105112

106-
### n8n credentials and workflows
113+
<a name="n8n-credentials-and-workflows"></a>
114+
### Review the n8n credentials and workflows
107115

108116
The postprovision hook automatically configures n8n:
109117

@@ -129,7 +137,7 @@ The n8n deployment supports two token flow patterns:
129137

130138
- **On-behalf-of (OBO) with MCP:** A browser-based SPA sends a bearer token to an n8n webhook. The webhook calls the Auth Manager workflow, which uses the Blueprint credentials to acquire a delegated token on behalf of the Agent User. The Auth Manager forwards the token to a subworkflow that calls the Microsoft Graph MCP Server for Enterprise, which translates MCP tool calls into Microsoft Graph API requests using the delegated token.
131139

132-
In both patterns, the Agent Identity Blueprint acts as a token factory. It issues tokens for Agent Identities without storing credentials on the agent itself. The Auth Manager community node handles token acquisition and AES-256-GCM caching within each workflow run.
140+
In both patterns, the Agent Identity Blueprint acts as a token factory. The Agent Identity Blueprint issues tokens for Agent Identities without storing credentials on the agent itself. The Auth Manager community node handles token acquisition and AES-256-GCM caching within each workflow run.
133141

134142
## Deploy the test SPA (optional)
135143

@@ -169,7 +177,7 @@ The deployment is fully idempotent:
169177
- The `azd` environment saves Microsoft Entra object IDs (Blueprint, Agent Identity, Agent User, Blueprint secret) after the first run and reuses them on subsequent runs.
170178
- n8n configuration (credentials, workflows) is applied fresh each run, which allows repairing a broken state.
171179

172-
To rerun just the postprovision scripts without modifying infrastructure:
180+
To rerun just the postprovision scripts without modifying infrastructure, run provisioning again. The Bicep templates detect no infrastructure changes and only execute the deployment hooks:
173181

174182
```bash
175183
azd provision # Bicep detects no changes, runs hooks only
@@ -206,7 +214,7 @@ You can run the configuration scripts independently if needed:
206214

207215
## Clean up resources
208216

209-
Remove all Azure resources that the deployment created:
217+
Remove all Azure resources that the deployment created and purge any retained deployment state:
210218

211219
```bash
212220
azd down --purge

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ titleSuffix: Microsoft Entra Agent ID
55

66

77
ms.topic: how-to
8-
ms.date: 06/03/2026
8+
ms.date: 06/15/2026
99
ms.reviewer: dastrock, jomondi
1010
ai-usage: ai-assisted
1111

1212
#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.
13+
ms.custom: msecd-doc-authoring-1013
1314
---
1415

1516
# Authenticate users and acquire tokens for interactive agents
@@ -76,6 +77,8 @@ Authorization: Bearer <token>
7677

7778
##### [Microsoft Graph PowerShell](#tab/microsoft-graph-powershell)
7879

80+
Use Microsoft Graph PowerShell to update the agent identity blueprint with the redirect URI.
81+
7982
```powershell
8083
Connect-MgGraph -Scopes "AgentIdentityBlueprint.ReadWrite.All" -TenantId <your-test-tenant>
8184

0 commit comments

Comments
 (0)