Amazon Cognito Adds Delegated OAuth Token Exchange for AI Agents

Summary
Amazon Cognito token exchange lets services and AI agents obtain downstream tokens that preserve user identity, identify the acting service, and restrict access by audience and scope.
Key points
- Cognito supports OAuth 2.0 Token Exchange (RFC 8693), letting a service exchange a user's access or ID token for a token intended for a downstream resource server.
- Delegation adds an act claim identifying the service acting for the user; impersonation represents the user without identifying the service.
- Exchanged tokens are limited to scopes allowed by both the subject token and app client, can be bound to an audience, and do not outlive the subject token or include a refresh token.
- Cognito checks the subject token's signature, expiry, revocation status, and user status; resource servers should also validate JWT claims and, for delegated requests, the act claim.
- Examples show exchanges performed by an MCP server, AgentCore Gateway through AgentCore Identity, or an agent running on AgentCore Runtime.
- The feature can be enabled in Cognito app-client authentication flows and used through the /oauth2/token endpoint or the GetDerivedToken API.
Article Details
- Event Type
- Amazon Cognito feature announcement: OAuth 2.0 token exchange for impersonation and delegation
- Impact
- The feature lets services and AI agents exchange a user token for a resource-bound token with only permitted scopes. Delegated tokens can identify both the user and the acting service in the act claim, supporting downstream authorization and audit logging. Cognito validates the exchange and does not allow it to add permissions beyond those available in the subject token.
Vendors
Products
AgentCore GatewayWe show it two ways: an MCP server you build that performs the exchange in its own code, and an AI gateway in Amazon Bedrock AgentCore Gateway that performs it through configuration.Amazon Bedrock AgentCore IdentityWe explain the difference between impersonation and delegation, and show you examples of how the feature works with an MCP server and Amazon Bedrock AgentCore Identity.Amazon Bedrock AgentCore RuntimeExample 2: The agent as the actor on AgentCore RuntimeAmazon CognitoIn this post, we show you how to use the new OAuth token exchange feature in Amazon Cognito when services and AI agents call your APIs on behalf of users, and Cognito serves as the OAuth 2.0 authorization server.
