Issue 1379 patch - Fix MCP server OAuth not working with Visual Studio Code and others with extra grant_types (#1380)
This commit is contained in:
parent
1940040ac3
commit
9323efad99
2 changed files with 19 additions and 2 deletions
|
|
@ -68,7 +68,7 @@ class RegistrationHandler:
|
|||
),
|
||||
status_code=400,
|
||||
)
|
||||
if set(client_metadata.grant_types) != {"authorization_code", "refresh_token"}:
|
||||
if not {"authorization_code", "refresh_token"}.issubset(set(client_metadata.grant_types)):
|
||||
return PydanticJSONResponse(
|
||||
content=RegistrationErrorResponse(
|
||||
error="invalid_client_metadata",
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ class OAuthClientMetadata(BaseModel):
|
|||
# ie: we do not support client_secret_basic
|
||||
token_endpoint_auth_method: Literal["none", "client_secret_post"] = "client_secret_post"
|
||||
# grant_types: this implementation only supports authorization_code & refresh_token
|
||||
grant_types: list[Literal["authorization_code", "refresh_token"]] = [
|
||||
grant_types: list[Literal["authorization_code", "refresh_token"] | str] = [
|
||||
"authorization_code",
|
||||
"refresh_token",
|
||||
]
|
||||
|
|
|
|||
Loading…
Reference in a new issue