RFC 9728 — OAuth 2.0 Protected Resource Metadata

Implemented (apiauth.NewProtectedResourceHandler)

RFC 9728 — OAuth 2.0 Protected Resource Metadata

Status: Standards Track
Published: 2024-04
L-tier / T-tier: L2 · T0 (setup / discovery)
OneAuth coverage: Implemented (apiauth.NewProtectedResourceHandler)
See also: RFC_8414.md · LANDSCAPE.md

In one sentence

RFC 9728 is the RS-side sibling of RFC 8414 — a JSON document at a
well-known URL on the resource server that tells clients which ASes the
RS trusts, which scopes it accepts, and how bearer tokens may be presented.

What problem does it solve?

Without 9728 With 9728
Clients learn about ASes from out-of-band docs; RS-AS relationships are implicit RS declares its trusted issuers in machine-readable form
Multi-tenant or multi-AS RSes need vendor-specific configuration mechanisms One discovery doc; SDKs auto-configure
Token-binding requirements (DPoP, mTLS) need separate documentation Advertised in the metadata directly
Discovery is asymmetric — AS-side standardized (8414), RS-side ad-hoc Symmetric: both sides discoverable

9728 closes a long-standing asymmetry. AS discovery has been standardized
since 8414 (2018) — but the RS side was a wild west until 2024. 9728 is
brand-new; deployment is still rare in production. Worth shipping
proactively because clients that can consume it will benefit.

Relatable example

You’re building an MCP (Model Context Protocol) server that exposes tools
via OAuth-protected endpoints. Today, you tell users:

“To connect, configure your client with: AS issuer
https://idp.example.com, our resource indicator
https://mcp.example.com, and required scopes tools:read tools:execute.”

With 9728, that documentation collapses to:

“Point your client at https://mcp.example.com.”

The client SDK fetches
https://mcp.example.com/.well-known/oauth-protected-resource, sees the
trusted AS, the required scopes, the supported bearer methods, and
auto-configures the rest. This is exactly the UX win MCP clients are
shipping toward in 2026 — 9728 is the spec they’re standardizing on.

Key concepts

  1. Two required fields: resource (RS identifier) and
    authorization_servers (array of trusted AS issuer URLs).
  2. bearer_methods_supported lists how the RS will accept tokens —
    header, body, query. Modern (OAuth 2.1) RSes list only header.
  3. Per-scope or per-resource policy can be advertised via optional
    fields (scopes_supported, resource_documentation).
  4. DPoP and mTLS hints: dpop_bound_access_tokens_required,
    tls_client_certificate_bound_access_tokens flag sender-constraint
    requirements.
  5. Discovery proxy pattern: an RS can optionally proxy the
    discovery doc of its trusted AS for client convenience. OneAuth has
    built-in support for this (see status table).

Wire example

GET /.well-known/oauth-protected-resource HTTP/1.1
Host: api.example.com
HTTP/1.1 200 OK
Content-Type: application/json
Cache-Control: public, max-age=3600

{
  "resource": "https://api.example.com",
  "authorization_servers": [
    "https://as.example.com"
  ],
  "scopes_supported": ["read", "write", "admin"],
  "bearer_methods_supported": ["header"],
  "resource_documentation": "https://docs.example.com/api",
  "resource_signing_alg_values_supported": ["RS256", "ES256"]
}

A client that finds this doc can:

  1. Identify the trusted AS (authorization_servers)
  2. Fetch that AS’s discovery doc (RFC 8414) to find its token endpoint
  3. Negotiate scopes from scopes_supported
  4. Know to use the Authorization header form (no body or query)
  5. All without a single hand-configured value

Where it lands on the OAuth abstraction

  • L2 lifecycle & discovery. Sibling to 8414 — same idea, RS side.
  • T0 (deployment setup). Discovery is queried once on client startup.
  • 9728 is the youngest L2 RFC. Adoption is still climbing; modern SDKs
    (MCP client libraries especially) consume it today, broader ecosystem
    rollout is still progressing.

OAuth 2.0 status

Published 2024 — fourteen years after 2.0. Not part of bare 6749. Adoption
in the wild is still early — most ASes’ associated RSes don’t yet publish
9728 metadata. Modern 2.0 RSes have no reason not to publish it; it’s
purely additive.

OAuth 2.1 status

Not mandated by 2.1, but heavily aligned with 2.1’s “make security
configuration discoverable” theme. 2.1 strict deployments will publish
9728 to advertise DPoP/mTLS-binding requirements.

The MCP ecosystem in particular has standardized on 9728 as the default
RS-side discovery mechanism — relevant for AI agent toolchains coming
online in 2026.

OneAuth status

9728 surface Status Where (grep-verified) Notes
/.well-known/oauth-protected-resource endpoint Implemented apiauth/protected_resource.go NewProtectedResourceHandler Single-handler form
MountProtectedResource registrar Implemented apiauth/protected_resource.go MountProtectedResource Bundles handler + optional AS metadata proxy. Each well-known pattern is mounted once, so several authorization servers no longer panic ServeMux (0.1.51). The bare proxy path goes to the first server; a path-based server keeps its own path
resource + authorization_servers required fields Implemented apiauth/protected_resource.go ProtectedResourceMetadata struct Tested in protected_resource_test.go (full + minimal-required modes)
bearer_methods_supported advertisement Implemented ProtectedResourceMetadata.BearerMethodsSupported field Caller-populated (omitempty); reference server sets ["header"], since OneAuth accepts header-form bearer only (RFC 6750 §2.1)
scopes_supported Implemented ProtectedResourceMetadata field —
AS-metadata proxy mode (RS proxies upstream oauth-authorization-server) Implemented MountProtectedResource(... , proxyASMetadata=true, ...) Convenience for clients that want one round-trip
dpop_bound_access_tokens_required Implemented ProtectedResourceMetadata.DPoPBoundAccessTokensRequired Pointer-typed tristate. Set it true only with APIMiddleware.RequireDPoP, which is what enforces it
dpop_signing_alg_values_supported Implemented ProtectedResourceMetadata.DPoPSigningAlgValuesSupported Fill from DPoPProofValidator.SigningAlgValuesSupported() so the advertisement cannot drift from what is accepted
resource_metadata in WWW-Authenticate (§5.1) Implemented apiauth/middleware.go APIMiddleware.ResourceMetadataURL When set, every challenge carries resource_metadata="<url>", so a client that got a 401 can find the authorization server (0.1.45)
tls_client_certificate_bound_access_tokens Not implemented — Tracked under mTLS gap in RFC_8705.md

When NOT to use it

You’ll almost always want to publish 9728 metadata on a new RS — it costs
nothing and unlocks self-configuring clients. The only carve-out:

  • Strictly internal RSes with a known client population that configures
    out-of-band may not benefit. But even there, publishing the doc helps
    future tooling and doesn’t hurt.
  • RFC 8414 — AS metadata sibling; same idea, AS side
  • RFC 6749 — the framework whose RS-side discovery 9728 fills
  • RFC 6750 — bearer_methods_supported advertises which of 6750’s transport options are accepted
  • RFC 9449 — DPoP; flags via dpop_bound_access_tokens_required
  • RFC 8705 — mTLS; flags via tls_client_certificate_bound_access_tokens