Skip to content
IAM Insights

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

share
8,321 words. With Michael Jones, author, Self-Issued Consulting; Phil Hunt, author, Independent Identity, Inc.; Aaron Parecki, author, Okta.
01

What's happening

Finding4
BI-FIND-2025-0390Lead finding

RFC 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.

high confidencebest source: independent researchobserved Apr 2025EvidenceSecurity considerations (§6–7)Section 3
flag a problem with BI-FIND-2025-0390
Figure steps
  1. The client calls the resource with no token. The resource server may answer 401 with a WWW-Authenticate header pointing to its metadata.
  2. The client fetches the protected resource metadata, which names the resource and can list its authorization servers.
  3. The client checks that the resource value is identical to the URL it called, and must not use the document if it is not.
  4. 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.
  5. The client calls the resource again, this time with the access token.
Fig. 1

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 →

BI-FIND-2025-0388

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.

BI-FIND-2025-0389

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.

high confidencebest source: independent researchobserved Apr 2025 – Oct 2026EvidenceWell-known retrieval and validation (§3)Security considerations (§6–7)
Also reported in +1 briefing
flag a problem with BI-FIND-2025-0389
BI-FIND-2025-0391

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.

high confidencebest source: independent researchobserved Apr 2025 – Jul 2026EvidenceSecurity considerations (§6–7)
Also reported in +1 briefing
flag a problem with BI-FIND-2025-0391
02

Section by section

4

showing 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

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

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

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

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

Terms used

OAuth 2.0 Protected Resource Metadata
A discovery document (RFC 9728) a resource server publishes at a well-known URL, naming the authorization server that protects it and the scopes it supports.
RFC
Request for Comments: the numbered document series in which the Internet Engineering Task Force publishes internet specifications, from standards such as RFC 8693 to informational notes. A draft is not an RFC.
OAuth
The web's standard framework for delegated authorization — letting one application act at another on a user's (or machine's) behalf without sharing passwords.
Application programming interface
Application programming interface: a defined way for software components to request operations or exchange data.
Resource server
In OAuth, the API that holds the protected data and accepts access tokens.
WWW-Authenticate
HTTP response header a server uses to challenge a client; RFC 9728 adds a resource_metadata parameter pointing at the resource's metadata.
JavaScript Object Notation (JSON)
The standardized JSON data-interchange syntax, defined in RFC 8259.
OAuth 2.0 Authorization Server Metadata
An IETF standard (RFC 8414) defining a well-known JSON document an OAuth client fetches to discover an authorization server's endpoints and capabilities, generalizing OpenID Connect Discovery to OAuth 2.0.

Read next

Was this briefing useful?

Share this briefing

Every finding, forecast and open question on this site has a permanent ID. If we reword one, its ID stays the same, so a citation keeps pointing to the same claim.

Follow us on LinkedInRSS feed

Working on an identity problem this research touches? Talk to Boston Identity