Skill 4.1.2
Design and implement authentication flows in a multi-agent solution, including user impersonation, on-behalf-of, API keys, and OAuth 2.0
Key Concepts
With on-behalf-of (OBO), a service that receives a user's access token exchanges it with Microsoft Entra ID for a token to a downstream API, so the downstream API sees and enforces the user's permissions. User impersonation (delegated permissions) means the agent acts as the user; it is appropriate when results must match what the user may see, and audit logs show the user. Acting as the agent (application permissions) suits background work with no user present.
OAuth 2.0 flows connect third-party tools: authorization code with user consent for user data, client credentials for service-to-service calls. Foundry MCP and OpenAPI tools support managed identity, OAuth identity passthrough and key-based connections. API keys carry no user identity and grant whatever the key allows, so they are used only when the API supports nothing else, stored in Key Vault or a Foundry connection and rotated.