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

Abierto
#1,538 0 comentarios 0 reacciones 1 asignado Ver en GitHub

Los mantenedores suelen responder en 1 día

@nahapetyan-serob ya está trabajando en esto.

Desde el 20/11/2026.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
45/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
go

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Go
Estrellas
5.4k
Forks
623
Merge medio
22 h 10 min
PR fusionados (30 d)
30

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de modelcontextprotocol/go-sdk

Todos los issues de modelcontextprotocol/go-sdk

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.