OAuth token exchange: request a token scoped for a downstream service
Learn how RFC 8693 exchanges an existing security token for one suited to another service, how delegation differs from impersonation, and how to constrain the target and permissions.
OAuth token exchange: request a token scoped for a downstream service
OAuth Token Exchange is an extension flow in which a client presents an existing security token to an authorization server and requests a new token suited to another target service or permission scope. In a system that calls several services in sequence, it can avoid forwarding the first service's token unchanged and instead issue a credential with a narrower audience and permissions. RFC 8693 also distinguishes two different authorization meanings: delegation and impersonation.
Why exchange a token?
Suppose service A receives a user's request and calls service B. If A forwards the user's original token unchanged, that token may grant broader access than B needs or may not show that A is acting as an intermediary. If the authorization server supports token exchange and its policy allows it, A can present the existing token and request a narrower token for B.
Token exchange is different from an authorization-code flow in which the user signs in again. It is generally a token request made by a server or trusted service at the token endpoint. The authorization server must support the extension and have an exchange policy configured. Do not assume that every OAuth 2.0 provider supports the same token types or parameters.
Delegation and impersonation
**Delegation:** A keeps its own service identity while acting on behalf of user B. The receiving service can determine that “A is acting for B.”
**Impersonation:** A acts as B. From the receiving service's perspective, A and B may be difficult to distinguish within the granted permission scope.
These are not merely different display formats. They affect audit records, accountability, and access policy. A delegated token may represent both the user and the actor, but the authorization server's claims and token format depend on its implementation and deployment policy. The RFC 8693 act claim is one way to represent actor information inside a JWT.
Basic request and response
RFC 8693 defines an extension grant sent to the token endpoint as an HTTP POST with an application/x-www-form-urlencoded body. The core fields are grant_type, which identifies token exchange, subject_token, which identifies the principal, and subject_token_type, which describes its type. If an actor_token is included, actor_token_type must also be included. resource or audience can identify the target service for the new token, while scope can state the permissions requested there.
POST /token HTTP/1.1
Host: auth.example
Content-Type: application/x-www-form-urlencoded
grant_type=urn:ietf:params:oauth:grant-type:token-exchange
&subject_token=<existing_token>
&subject_token_type=urn:ietf:params:oauth:token-type:access_token
&resource=https%3A%2F%2Fapi.example%2Forders
&scope=orders%3AreadThis request is illustrative. Confirm the actual endpoint, client authentication, accepted input token types, and allowed permissions for the deployment. The authorization server may not support resource, audience, or scope. Do not put authentication credentials or subject/actor tokens in browser code or logs.
A successful response is JSON containing fields such as access_token, issued_token_type, and token_type. issued_token_type describes the kind of credential returned; token_type describes how to present it to a resource. RFC 8693 uses the field name access_token for historical reasons; it does not guarantee that the returned security token is an ordinary OAuth access token. If the server grants a different scope from the one requested, the response must indicate the scope actually granted.
Token exchange does not normally invalidate the original subject or actor token automatically. Revoking input tokens, expiring or refreshing the new token, and propagating revocation events depend on the token type and provider policy. A successful exchange by itself does not reduce existing permissions or make the new token automatically safer.
Requesting a narrower target and scope
Identify the downstream service that will be called. When needed, use the exact `resource` URI or `audience` understood by that service.
Request only the minimum `scope` needed at that target. Combining multiple resources and scopes in one request can create a broader permission combination for the authorization server to interpret and may make the request harder to satisfy.
Confirm that the authorization server checks the issuer, type, and validity of the `subject_token` and optional `actor_token`.
Check that policy considers the user's permissions, A's service identity, and the target resource. Being able to call the token-exchange endpoint does not grant the right to delegate arbitrary user permissions.
Configure service B to validate the new token's issuer, audience, scope, expiry, and any required delegation information.
Check whether audit logs distinguish the user (subject) from the calling actor, without recording raw tokens.
Operational checklist
| Question | What to check |
|---|---|
| Is exchange needed? | Is there a reason to reduce permissions or clarify the issuance context instead of forwarding the original token to the downstream service? |
| Who is acting for whom? | Which meaning, delegation or impersonation, fits the target API's policy and audit requirements? |
| Which tokens are trusted? | Does the authorization server validate the issuer, type, audience, and status of subject and actor tokens? |
| Where can the token be used? | Is the new token valid only for the exact resource or audience? |
| How much permission is granted? | Is the minimum scope applied for each target service? Are broad multi-target requests avoided? |
| What happens on failure? | Are exchange denial, authorization-server outages, and downstream expiry or rejection handled safely? |
| What happens to the original? | Are expiry, revocation, and retention of input tokens designed separately from exchange? |
Summary
OAuth Token Exchange is the RFC 8693 extension flow for presenting an existing security token and requesting a new one suited to a different service context. Specify the target service and minimum permissions, and distinguish delegation on behalf of a user from acting as that user's identity for policy and auditing. The issued token, revocation of input tokens, refresh, and revocation propagation depend on authorization-server policy and deployment.
References
[RFC 8693 — OAuth 2.0 Token Exchange](https://www.rfc-editor.org/rfc/rfc8693.html)
[RFC 9700 §2.3 — Access Token Privilege Restriction](https://www.rfc-editor.org/rfc/rfc9700.html#section-2.3)
[RFC 7662 — OAuth 2.0 Token Introspection](https://www.rfc-editor.org/rfc/rfc7662.html)