feat: specify supported grant tyoes
This commit is contained in:
@ -9,11 +9,12 @@ import (
|
|||||||
|
|
||||||
func (h *OAuthHandler) OpenIdConfiguration(w http.ResponseWriter, r *http.Request) {
|
func (h *OAuthHandler) OpenIdConfiguration(w http.ResponseWriter, r *http.Request) {
|
||||||
type Response struct {
|
type Response struct {
|
||||||
TokenEndpoint string `json:"token_endpoint"`
|
TokenEndpoint string `json:"token_endpoint"`
|
||||||
AuthorizationEndpoint string `json:"authorization_endpoint"`
|
AuthorizationEndpoint string `json:"authorization_endpoint"`
|
||||||
JwksURI string `json:"jwks_uri"`
|
JwksURI string `json:"jwks_uri"`
|
||||||
Issuer string `json:"issuer"`
|
Issuer string `json:"issuer"`
|
||||||
EndSessionEndpoint string `json:"end_session_endpoint"`
|
EndSessionEndpoint string `json:"end_session_endpoint"`
|
||||||
|
GrantTypesSupported []string `json:"grant_types_supported"`
|
||||||
}
|
}
|
||||||
|
|
||||||
w.Header().Set("Content-Type", "application/json")
|
w.Header().Set("Content-Type", "application/json")
|
||||||
@ -28,6 +29,10 @@ func (h *OAuthHandler) OpenIdConfiguration(w http.ResponseWriter, r *http.Reques
|
|||||||
JwksURI: h.cfg.Uri + "/.well-known/jwks.json",
|
JwksURI: h.cfg.Uri + "/.well-known/jwks.json",
|
||||||
Issuer: h.cfg.Uri,
|
Issuer: h.cfg.Uri,
|
||||||
EndSessionEndpoint: h.cfg.Uri + "/api/v1/oauth/logout",
|
EndSessionEndpoint: h.cfg.Uri + "/api/v1/oauth/logout",
|
||||||
|
GrantTypesSupported: []string{
|
||||||
|
"authorization_code",
|
||||||
|
"refresh_token",
|
||||||
|
},
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
web.Error(w, "failed to encode response", http.StatusInternalServerError)
|
web.Error(w, "failed to encode response", http.StatusInternalServerError)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user