Briefing · Article · source · published · Boston Identity
RFC 9728 tells clients where an API's tokens come from and leaves most of the trust decision to them
RFC 9728, a Standards Track RFC from Michael B. Jones, Phil Hunt and Aaron Parecki, gives an OAuth-protected API a metadata document that a client can find from a 401 response. The document can name the API's authorization servers, and the client must check that it belongs to the URL it called. Beyond an optional cross-check between the resource's list of servers and a server's list of resources, the authors leave the choice of which server to trust to the client.
RFC Editor · Michael B. Jones, Phil Hunt, Aaron Parecki · Apr 2025 · read
What's happening
Finding4RFC 9728 lets a resource name the authorization servers it uses and leaves most of the decision whether to trust them to the client.
RFC 9728 lets a resource tell a client which authorization servers it uses, and leaves most of the decision whether to trust them to the client. Its partial answer covers cases where the lists can be enumerated: authorization server metadata gains an optional protected_resources list, and the authors say that when an application profile uses both lists they should be cross-checked against each other for consistency. Beyond that, the authors put "secure determination of appropriate authorization servers" for all use cases out of scope and assume the client already has a way to make that call. They warn that a client using an inappropriate authorization server may let an attacker act as an adversary-in-the-middle proxy to a valid one without the client or that server detecting it. Unsigned metadata is only as trustworthy as TLS and the web PKI make it. Signed metadata lets a client weigh who signed it, but how that trust decision is made is out of scope too.
flag a problem with BI-FIND-2025-0390
Figure steps
- The client calls the resource with no token. The resource server may answer 401 with a WWW-Authenticate header pointing to its metadata.
- The client fetches the protected resource metadata, which names the resource and can list its authorization servers.
- The client checks that the resource value is identical to the URL it called, and must not use the document if it is not.
- The client fetches the authorization server's own metadata and runs a normal OAuth flow. Choosing that server securely, for all use cases, is out of scope.
- The client calls the resource again, this time with the access token.
The client checks that the metadata belongs to the URL it called; whether to trust the authorization server that metadata names is left to the client.
Drawn from RFC 9728, figure 1 and sections 3.3 and 7.6Source dated Apr 2025Passage: Section 3
Swipe for the full figure →
RFC 9728 lets a client that knows nothing about an API learn where to get a token for it, from a metadata document the resource server can point to.
RFC 9728 lets a client that knows nothing about an API find out where to get a token for it. The resource server may answer an unauthenticated call with a WWW-Authenticate header whose resource_metadata parameter points to a JSON metadata document; the client reads the authorization server from it and then fetches that server's own RFC 8414 metadata. A later challenge tells the client the metadata may have changed, which the authors say lets a resource server change authorization servers "without any other coordination with clients." Only the resource field is required, authorization_servers is optional, and how the client gets a client identifier is out of scope. The RFC never mentions AI agents. Our briefing on the Model Context Protocol's 2026-07-28 authorization specification found that it requires MCP servers to publish this document.
flag a problem with BI-FIND-2025-0388
The RFC defends against a forged metadata document with a client check: data whose resource value differs from the URL the client used MUST NOT be used.
The RFC's defence against a forged metadata document is a comparison the client makes. The resource value in the document MUST be identical to the identifier the client used to build the metadata URL or, when the URL came from a WWW-Authenticate challenge, to the URL the client called. If they differ, "the data contained in the response MUST NOT be used." The authors say this blocks an attacker who publishes a document carrying another resource's identifier with values of its own choosing, and they make TLS certificate checking on the metadata request a MUST as well. We read the check as proof that the document belongs to the URL the client called, which says nothing about whether that resource is honest. Our briefing on three MCP authorization bugs found one MCP SDK that never made this comparison.
Also reported in +1 briefing
flag a problem with BI-FIND-2025-0389
Two risks the authors name come from a client following a resource's pointers: token replay at a legitimate server and server-side request forgery.
Two of the risks the authors name come from a client following pointers a resource hands it. A malicious resource server can use a WWW-Authenticate challenge to get a client to request a token with a legitimate server's scope, then replay that token at the legitimate server. The authors say the attack is possible in plain OAuth but "made somewhat more likely by the use of dynamically configured clients," so they recommend audience-restricted tokens and Resource Indicators (RFC 8707), and say a client that talks to several resource servers SHOULD request them. Because the client fetches an issuer it learned from the resource, clients SHOULD also guard against server-side request forgery, for example by blocking internal IP address ranges.
flag a problem with BI-FIND-2025-0391
Section by section
4showing 4 of 4
[1]Metadata format and signed metadata (§1–2)
Michael Jones, Self-Issued Consulting · Phil Hunt, Independent Identity, Inc. · Aaron Parecki, Okta
Standards
Metadata format and signed metadata (§1–2)
Michael Jones, Self-Issued Consulting · Phil Hunt, Independent Identity, Inc. · Aaron Parecki, Okta
RFC 9728 defines a JSON metadata document a protected resource publishes about itself, parallel to RFC 7591 and RFC 8414. Only `resource` is REQUIRED; `authorization_servers`, `jwks_uri`, `scopes_supported`, DPoP and mTLS flags are optional. Metadata may also arrive as a signed JWT whose values take precedence. How a client first finds the resource is out of scope.
technical artifactfrom published text
[2]Well-known retrieval and validation (§3)
Michael Jones, Self-Issued Consulting · Phil Hunt, Independent Identity, Inc. · Aaron Parecki, Okta
Standards
Well-known retrieval and validation (§3)
Michael Jones, Self-Issued Consulting · Phil Hunt, Independent Identity, Inc. · Aaron Parecki, Okta
Metadata is served at /.well-known/oauth-protected-resource inserted between host and path of the resource identifier, so each resource under one host gets its own document. The client MUST reject a response whose `resource` value is not identical to the identifier it used (or the URL it called, when found via WWW-Authenticate). Signed metadata MUST be verified against the issuer's key.
technical artifactfrom published text
[3]Authorization server link and WWW-Authenticate discovery (§4–5)
Michael Jones, Self-Issued Consulting · Phil Hunt, Independent Identity, Inc. · Aaron Parecki, Okta
Standards
Authorization server link and WWW-Authenticate discovery (§4–5)
Michael Jones, Self-Issued Consulting · Phil Hunt, Independent Identity, Inc. · Aaron Parecki, Okta
A resource server MAY answer an unauthenticated request with a `resource_metadata` parameter in WWW-Authenticate pointing at its metadata; the client then reads the authorization server issuer, fetches RFC 8414 metadata and runs a normal flow (figure 1). A later challenge signals changed metadata and lets a resource switch authorization servers without coordinating with clients. Client registration is left out of scope; DCR is named as one option.
technical artifactfrom published text + figures
[4]Security considerations (§6–7)
Michael Jones, Self-Issued Consulting · Phil Hunt, Independent Identity, Inc. · Aaron Parecki, Okta
Standards
Security considerations (§6–7)
Michael Jones, Self-Issued Consulting · Phil Hunt, Independent Identity, Inc. · Aaron Parecki, Okta
The authors name the risks: impersonation via a forged metadata document (answered by the exact `resource` match), a malicious resource server reusing a token at another (audience-restricted tokens RECOMMENDED), SSRF from fetching attacker-named issuers, and phishing. Choosing the right authorization server is out of scope, and unsigned metadata rests on TLS and the web PKI.
technical artifactfrom published text