(w http.ResponseWriter, r *http.Request)
| 97 | } |
| 98 | |
| 99 | func (s *state) handleServerMetadata(w http.ResponseWriter, r *http.Request) { |
| 100 | issuer := getBaseURL(r) |
| 101 | metadata := AuthServerMeta{ |
| 102 | Issuer: issuer, |
| 103 | AuthorizationEndpoint: issuer + "/authorize", |
| 104 | TokenEndpoint: issuer + "/token", |
| 105 | RegistrationEndpoint: issuer + "/register", |
| 106 | JWKSURI: issuer + "/.well-known/jwks.json", |
| 107 | ScopesSupported: []string{"openid", "profile", "email"}, |
| 108 | ResponseTypesSupported: []string{"code"}, |
| 109 | GrantTypesSupported: []string{"authorization_code"}, |
| 110 | TokenEndpointAuthMethodsSupported: []string{"none"}, |
| 111 | CodeChallengeMethodsSupported: []string{"S256"}, |
| 112 | } |
| 113 | var buf bytes.Buffer |
| 114 | if err := json.NewEncoder(&buf).Encode(metadata); err != nil { |
| 115 | http.Error(w, err.Error(), http.StatusInternalServerError) |
| 116 | return |
| 117 | } |
| 118 | w.Header().Set("Content-Type", "application/json") |
| 119 | w.Write(buf.Bytes()) |
| 120 | } |
| 121 | |
| 122 | // handleDynamicClientRegistration handles dynamic client registration requests, |
| 123 | // as defined in RFC 7591. |
nothing calls this directly
no test coverage detected