oauthex: GetProtectedResourceMetadata's strict resource equality blocks RFC 9728-conformant servers

Aperta
#1,538 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@nahapetyan-serob ci sta già lavorando.

Dal 20/11/2026.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
go

Direzione di ricerca

Start with GetProtectedResourceMetadata in resource_meta.go:135 and compare its strict resource check with MatchesResource in audience.go:33; read RFC 9728 §3.3 for the intended resource semantics. Check the auth-code flow in authorization_code.go for existing fallback behavior. Done means direct callers can handle advertised resource values as described and can fetch metadata without validation; the issue does not specify the API shape or tests.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

oauthex.GetProtectedResourceMetadata (resource_meta.go:135) rejects a PRM whose resource field differs from the URL the client passed, per RFC 9728 §3.3 — but §3.3's model is that the PRM IDENTIFIES the protected resource and the client should request a token FOR the advertised value, not demand it equal the endpoint URL. Servers advertising the issuer form (resource = origin while the endpoint is origin/mcp) are rejected by the strict !=, even though the package already exports oauthex.MatchesResource (audience.go:33) — unused at the validation site.

The SDK's own auth-code flow tolerates this per-candidate (authorization_code.go swallows validation errors and falls back), so only direct callers of the strict helper hit the wall.

Two asks:

  1. Consider MatchesResource-style tolerance (or an opt-out) at the validation site.
  2. Expose a fetch-without-validation variant (getJSON is unexported) so clients can follow §3.3's model without hand-rolling the fetch.

Context: mcpcli (github.com/ConsulTent/mcpcli) hit this against an OAuth-armed MCP appliance enforcing resource indicators and worked around it with a local PRM fetch.

Lingua principale
Go
Stelle
5.4k
Fork
623
Merge medio
22h 10m
PR unite (30g)
30

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di modelcontextprotocol/go-sdk

Tutte le issue di modelcontextprotocol/go-sdk

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.