@@ -103,36 +103,6 @@ type discoveryOAuth2 struct {
103103 AuthMethods []string `json:"token_endpoint_auth_methods_supported,omitempty"`
104104}
105105
106- // protectedResourceMetadata represents the OAuth 2.0 Protected Resource Metadata
107- // defined in RFC 9728. This enables MCP clients to discover the authorization
108- // server(s) that protect this resource.
109- type protectedResourceMetadata struct {
110- Resource string `json:"resource"`
111- AuthorizationServers []string `json:"authorization_servers"`
112- ScopesSupported []string `json:"scopes_supported,omitempty"`
113- BearerMethodsSupported []string `json:"bearer_methods_supported,omitempty"`
114- }
115-
116- func (s * Server ) handleProtectedResourceMetadata (w http.ResponseWriter , r * http.Request ) {
117- meta := protectedResourceMetadata {
118- Resource : s .issuerURL .String (),
119- AuthorizationServers : []string {s .issuerURL .String ()},
120- ScopesSupported : []string {"openid" , "email" , "groups" , "profile" , "offline_access" },
121- BearerMethodsSupported : []string {"header" },
122- }
123-
124- data , err := json .MarshalIndent (meta , "" , " " )
125- if err != nil {
126- s .logger .ErrorContext (r .Context (), "failed to marshal protected resource metadata" , "err" , err )
127- s .renderError (r , w , http .StatusInternalServerError , "Internal server error." )
128- return
129- }
130-
131- w .Header ().Set ("Content-Type" , "application/json" )
132- w .Header ().Set ("Content-Length" , strconv .Itoa (len (data )))
133- w .Write (data )
134- }
135-
136106type DiscoveryType int
137107
138108const (
0 commit comments