Skip to content

Commit 13b3569

Browse files
fix(metadata): advertise refresh_token in grant_types_supported
Discovery endpoints listed only authorization_code while /oauth/token already handled refresh_token. Conformant MCP clients skip silent renewal when grant_types_supported omits refresh_token (RFC 8414). Upstream PR candidate for tuannvm/oauth-mcp-proxy. Co-authored-by: Cursor <cursoragent@cursor.com> Signed-off-by: caiopavanelli <caiopava@gmail.com>
1 parent ba543d8 commit 13b3569

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

metadata.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ func (h *OAuth2Handler) HandleMetadata(w http.ResponseWriter, r *http.Request) {
4747
"registration_endpoint": fmt.Sprintf("%s/oauth/register", h.config.MCPURL),
4848
"response_types_supported": []string{"code"},
4949
"response_modes_supported": []string{"query"},
50-
"grant_types_supported": []string{"authorization_code"},
50+
"grant_types_supported": []string{"authorization_code", "refresh_token"},
5151
}
5252

5353
// Add provider-specific metadata
@@ -247,7 +247,7 @@ func (h *OAuth2Handler) HandleOIDCDiscovery(w http.ResponseWriter, r *http.Reque
247247
"registration_endpoint": fmt.Sprintf("%s/oauth/register", h.config.MCPURL),
248248
"response_types_supported": []string{"code"},
249249
"response_modes_supported": []string{"query"},
250-
"grant_types_supported": []string{"authorization_code"},
250+
"grant_types_supported": []string{"authorization_code", "refresh_token"},
251251
"token_endpoint_auth_methods_supported": []string{"none"},
252252
"code_challenge_methods_supported": []string{"plain", "S256"},
253253
"subject_types_supported": []string{"public"},
@@ -288,7 +288,7 @@ func (h *OAuth2Handler) GetAuthorizationServerMetadata() map[string]interface{}
288288
"issuer": h.config.Issuer, // OAuth provider issuer
289289
"response_types_supported": []string{"code"},
290290
"response_modes_supported": []string{"query"},
291-
"grant_types_supported": []string{"authorization_code"},
291+
"grant_types_supported": []string{"authorization_code", "refresh_token"},
292292
"token_endpoint_auth_methods_supported": []string{"none"},
293293
"code_challenge_methods_supported": []string{"plain", "S256"},
294294
"scopes_supported": h.config.Scopes,
@@ -320,7 +320,7 @@ func (h *OAuth2Handler) GetAuthorizationServerMetadata() map[string]interface{}
320320
"jwks_uri": fmt.Sprintf("%s/.well-known/jwks.json", h.config.MCPURL),
321321
"response_types_supported": []string{"code"},
322322
"response_modes_supported": []string{"query"},
323-
"grant_types_supported": []string{"authorization_code"},
323+
"grant_types_supported": []string{"authorization_code", "refresh_token"},
324324
"token_endpoint_auth_methods_supported": []string{"none"},
325325
"code_challenge_methods_supported": []string{"plain", "S256"},
326326
"scopes_supported": h.config.Scopes,

0 commit comments

Comments
 (0)