mirror of
https://github.com/wso2/open-mcp-auth-proxy.git
synced 2025-07-08 13:14:15 +00:00
Merge 1964829dcd
into 56cdc96cb6
This commit is contained in:
commit
5e1ea3aaf1
15 changed files with 609 additions and 100 deletions
|
@ -350,3 +350,23 @@ func randomString(n int) string {
|
|||
}
|
||||
return string(b)
|
||||
}
|
||||
|
||||
func (p *asgardeoProvider) ProtectedResourceMetadataHandler() http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
meta := map[string]interface{}{
|
||||
"resource": p.cfg.ResourceIdentifier,
|
||||
"scopes_supported": p.cfg.ScopesSupported,
|
||||
"authorization_servers": p.cfg.AuthorizationServers,
|
||||
}
|
||||
if p.cfg.JwksURI != "" {
|
||||
meta["jwks_uri"] = p.cfg.JwksURI
|
||||
}
|
||||
if len(p.cfg.BearerMethodsSupported) > 0 {
|
||||
meta["bearer_methods_supported"] = p.cfg.BearerMethodsSupported
|
||||
}
|
||||
if err := json.NewEncoder(w).Encode(meta); err != nil {
|
||||
http.Error(w, "failed to encode metadata", http.StatusInternalServerError)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue