Some quick references to various OAuth documents that I find myself repeatedly looking up, for work.
Registry of parameters#
This is a super helpful all-up view of the exact parameter names from various OAuth RFCs.
https://www.iana.org/assignments/oauth-parameters
The main RFC's#
- RFC 6749: The OAuth 2.0 Authorization Framework
- RFC 9700 BCP 240: Best Current Practice for OAuth 2.0 Security
OAuth 2.1#
Most important changes:
| Change | Practical effect |
|---|---|
| Authorization code + PKCE required | PKCE is required for both public and confidential clients. Only the S256 method is supported. |
| Implicit grant removed | Use authorization code + PKCE instead of returning access tokens directly in the authorization response. |
| Password grant removed | Applications must not collect user passwords to exchange them for tokens. |
| Exact redirect URI matching | Prevents loose matching from sending authorization responses to attacker-controlled locations. |
| Stronger refresh-token protection for public clients | Refresh tokens must be sender-constrained or rotated after each use. |
| No bearer tokens in URL query strings | Reduces exposure through logs and other URL storage. |
Source: Draft §10 — Differences from OAuth 2.0.
Authorizing your TV or fridge#
Device Authorization Grant 8628 is the RFC that breaks that flow down.
Requirements
- The device is already connected to the Internet.
- The device is able to make outbound HTTPS requests.
- The device is able to display or otherwise communicate a URI and code sequence to the user.
- The user has a secondary device (e.g., personal computer or smartphone) from which they can process the request.
Example from amp CLI that uses the []verification_uri_complete](https://datatracker.ietf.org/doc/html/rfc8628#section-3.2) repsonse field.
And to constrast, here's amp CLI taking the user through the usual authorization_code flow,
Authorization Server Metadata#
An authorization server's means of advertising its configuration and supported features to clients.
Here's example data from https://clerk.thekevinwang.com/.well-known/openid-configuration. Another valid endpoint is https://clerk.thekevinwang.com/.well-known/oauth-authorization-server.
{issuer: "https://clerk.thekevinwang.com",authorization_endpoint: "https://clerk.thekevinwang.com/oauth/authorize",token_endpoint: "https://clerk.thekevinwang.com/oauth/token",revocation_endpoint: "https://clerk.thekevinwang.com/oauth/token/revoke",introspection_endpoint: "https://clerk.thekevinwang.com/oauth/token_info",userinfo_endpoint: "https://clerk.thekevinwang.com/oauth/userinfo",jwks_uri: "https://clerk.thekevinwang.com/.well-known/jwks.json",scopes_supported: [0: "email",1: "profile",2: "public_metadata",3: "private_metadata",4: "openid",5: "offline_access",6: "mcp:all"],response_types_supported: [0: "code"],response_modes_supported: [0: "form_post",1: "query"],grant_types_supported: [0: "authorization_code",1: "refresh_token"],subject_types_supported: [0: "public"],id_token_signing_alg_values_supported: [0: "RS256"],token_endpoint_auth_methods_supported: [0: "client_secret_basic",1: "none",2: "client_secret_post"],claims_supported: [0: "email",1: "given_name",2: "name",3: "preferred_username",4: "sub",5: "aud",6: "exp",7: "email_verified",8: "family_name",9: "picture",10: "iss",11: "iat"],code_challenge_methods_supported: [0: "S256"],backchannel_logout_supported: false,frontchannel_logout_supported: false,authorization_response_iss_parameter_supported: true}PKCE#
Proof key for code exchange (PKCE) prevents intercepted authorization codes from being exchangeable for access tokens.
PKCE adds:
code_verifier: high-entropy, per-request secret.code_challenge: one-way derived verifier value.code_challenge_method:S256. OAuth 2.1 removesplain.- Challenge binding: authorization server stores the challenge with the authorization code.
- Proof at redemption: client sends the verifier to
POST /token. - Server validation: derive and compare; reject mismatch.
- One-time, short-lived authorization code: required container for that binding.
MCP & Token exchange#
A sequence diagram for MCP auth flow, commonly seen nowadays.
Token exchange in this scenario is one option for complying with acceess token privilege restriction, as documented in the MCP 2026-07-28 spec.
If the MCP server makes requests to upstream APIs, it may act as an OAuth client to them. The access token used at the upstream API is a separate token, issued by the upstream authorization server. The MCP server MUST NOT pass through the token it received from the MCP client.
ID-JAG (XAA)#
Overview#
Hypothetical scenario
Registration steps#
- Google enables ID-JAG issuance and RFC 8693 token exchange.
- booking.ai registers the Travel Agent with Google Identity.
- Google gives the Travel Agent an OAuth client ID and credentials.
- booking.ai registers the Travel Agent with BigAirline OAuth.
- BigAirline gives the Travel Agent a separate client ID and credentials.
- BigAirline configures trust in Google’s issuer, signing keys, and identity claims.
- Google and BigAirline map the two client registrations. A global URL client ID can replace this mapping.
- Google configures which BigAirline audiences, resources, and scopes the Travel Agent can request.
- BigAirline configures user matching and local access policy.
- The BigAirline API configures trust in tokens from BigAirline OAuth.
Runtime steps#
- The traveler signs in to booking.ai with Google.
- Google authenticates the traveler.
- Google returns an ID Token and, optionally, a refresh token.
- The Travel Agent sends the ID Token to Google in an RFC 8693 token-exchange request.
- The request identifies BigAirline OAuth as the
audienceand the BigAirline API as theresource. - Google validates the traveler, client, requested access, and policy.
- Google returns a signed ID-JAG for BigAirline OAuth.
- The Travel Agent authenticates to BigAirline OAuth.
- The Travel Agent redeems the ID-JAG with an RFC 7523 JWT bearer grant.
- BigAirline validates the Google signature, audience, client binding, user identity, and requested access.
- BigAirline returns an access token for its API.
- The Travel Agent calls the BigAirline API with that access token.
- The API validates the token and returns the authorized data.
- booking.ai shows the result to the traveler.
Registration#
Runtime#
FAQ#
Q: What is the state parameter's purpose in a autorization code flow,#
The client:
- Creates a random state value and stores it against the browser session.
- Sends it in the authorization request.
- Receives the same value in the redirect from the authorization server.
- Checks that it matches, then removes the stored value.
An unexpected or missing value causes the client to reject the response. This helps prevent
cross-site request forgery (CSRF), including unwanted login attempts.
Q: Which parties govern the aud claim in an access token?#
RFC 8707 §2.2 leaves acceptable resources to authorization-server policy and configuration 1
RFC 9068 §3 also leaves scope-to-default-resource mappings to the implementation. 2
RFC 9728 §4 An authorization server can publish an optional protected_resources list in its metadata. However, that list can omit supported resources, so it is not necessarily the canonical database. 3
Q: What is the Step up flow?#
Allows a resource server to request a client to obtain a new access token with a higher level of authentication and or recency.
RFC 94704 extends RFC 67505 with new parameters and a new error code:
| Name | Usage Location | Protocol Extension | Ref |
|---|---|---|---|
acr_values | authorization request | https://openid.net/specs/openid-connect-core-1_0.html | |
max_age | authorization request | https://openid.net/specs/openid-connect-core-1_0.html | |
insufficient_user_authentication | resource access error response | OAuth 2.0 Step Up Authentication Challenge Protocol | RFC 9470 |
The resource server can use these parameters to explicitly communicate to the client the required authentication strength or recentness.
Client then makes an auth request to AS w/ acr_values and max_age.
Footnotes#
-
RFC 8707 Resource Indicators for OAuth 2.0: https://www.rfc-editor.org/info/rfc8707 ↩
-
RFC 9068 JSON Web Token (JWT) Profile for OAuth 2.0 Access Tokens: https://www.rfc-editor.org/info/rfc9068 ↩
-
RFC 9728 OAuth 2.0 Protected Resource Metadata: https://www.rfc-editor.org/info/rfc9728 ↩
-
RFC 9470 OAuth 2.0 Step Up Authentication Challenge Protocol: https://www.rfc-editor.org/info/rfc9470 ↩
-
RFC 6750 The OAuth 2.0 Authorization Framework: Bearer Token Usage: https://www.rfc-editor.org/info/rfc6750 ↩