Grant type is hardcoded `authorization_code` for DCR

Abierto
#222 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
64/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
swift

Línea de trabajo

Start with Sources/MCP/Base/Authorization/OAuthClientRegistrar.swift around line 82 and trace how client metadata is assembled for dynamic client registration. Define how callers can provide additional grant types such as refresh_token, then verify that the registration request declares the configured values and supports the reported offline_access flow.

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

Descripción

bug

Describe the bug
In OAuthClientRegistrar the declared grant types for client registration are hard coded to authorization_code with no option to add additional grant types such as refresh_token. For authorization servers that require refresh_token grant type be declared during client registration, this effectively prevents clients from using refresh tokens with some authorization servers.

Both Python and Typescript MCP SDKs provide OAuthClientProvider/OAuthClientMetadata constructs to allow specifying grant types as well as other client metadata.

To Reproduce
Steps to reproduce the behavior:

  1. DCR with an MCP server/authz server that requires refresh_token declaration
  2. Request offline_access scope during authorization
  3. (may or may not get a refresh token depending on the authz server)
  4. Try to exchange the refresh token for a new access token
  5. Request will be rejected

Expected behavior
Provide a mechanism to specify grant types to be declared at client registration time.

Logs
n/a

Additional context
Mentioned above, but to reiterate, other official MCP SDKs (e.g. Typescript, Python, etc.) do support specifying grant types through configuration.

Lenguaje dominante
Swift
Estrellas
1.6k
Forks
270
Merge medio
2 d 7 h
PR fusionados (30 d)
15

Preparar el entorno

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/swift-sdk

Todos los issues de modelcontextprotocol/swift-sdk

Issues similares

Más issues de Swift

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.