Token exchange
Exchanging one token for another to call further services, act on someone's behalf, or cross trust boundaries.
Start with The problem token exchange solves
- The problem token exchange solvesSee why an API calling another service on a person's behalf needs a new token, and how an authorization server acting as a token service issues one.
- Delegation, impersonation, and actor tokensLabel the token being exchanged, compare tokens that make their holder indistinguishable from the person with tokens that name who acts, and see how may_act and an actor token bring in a support agent.
- Following a token exchangeFollow the photo API as it exchanges the printer's token for a storage token, read every field of the request, response and new token, then follow storage's own exchange and its nested act chain.
- Scopes, resources, and audiencesName the target of an exchange with resource or audience, ask for one target at a time, and narrow scope so an exchange never adds access.
- Trust and validationWork through what an authorization server checks before exchanging a token, from client permission to lifetime, and what the downstream API checks afterwards.
- Errors and failure casesRead token exchange errors, handle subject tokens that expire mid-operation, decide which failures to retry and which service in a chain can recover, and trace a chain without logging tokens.