NewsLayer.com

Delegate user access to AI agents with Amazon Cognito token exchange

Suppose you use a restaurant review app to check reviews, book tables, and email invitations to your friends. With OAuth 2.0, the app sends you to the authorization server that your email provider trusts, where you sign in and approve…

Amazon Web Services

Publisher

Nov 24, 2026 at 8:01 PM UTC · Updated một giờ trước · 15 phút đọc

Delegate user access to AI agents with Amazon Cognito token exchange
Image via Amazon Web Services
Đang dịch…

Suppose you use a restaurant review app to check reviews, book tables, and email invitations to your friends. With OAuth 2.0, the app sends you to the authorization server that your email provider trusts, where you sign in and approve only the access the app requested, such as the contacts.read and messages.send scopes. The review app won’t sees your credentials. It only receives a short-lived access token limited to the scopes you approved, which it presents to your email provider’s API to read your contacts and send invitation emails on your behalf.

That works while the app calls the email API directly, but many requests take a second hop to call downstream services. When you book a table, the app calls its reservation service with your token to email details to your friends, which token should the reservation service use to call the email API? Forwarding the access token issued to the review app hides the reservation service because the email API thinks the app sent the request. Using the reservation service’s own token from an OAuth 2.0 client credentials grant loses user identity, because the email API knows which service called, but not for which user. Figure 1 shows this second hop.

Article Intelligence

Topics

Sponsored

Ad
House — Advertise on NewsLayer
NewsLayerLearn more

NewsLayer Premium

Unlock deeper intelligence.

Ad-free reading, exclusive research, and real-time onchain insights.

Go Premium