~netlandish/gobwebs-oauth2

79218093c639e63034644bd5dda5e92bbb97e368 — Peter Sanchez 1 year, 4 months ago 30c7e57
Add support for RFC 9207
1 files changed, 4 insertions(+), 0 deletions(-)

M routes.go
M routes.go => routes.go +4 -0
@@ 439,8 439,10 @@ func (s *Service) AuthorizePOST(c echo.Context) error {
		return s.authorizeError(c, "", state, "server_error", err.Error())
	}

	origin := gctx.Server.Config.BaseURI()
	gmap := gobwebs.Map{
		"code": code,
		"iss":  origin, // RFC 9207
	}
	if state != "" {
		gmap["state"] = state


@@ 704,6 706,7 @@ func (s *Service) OAuthMetadata(c echo.Context) error {
		Doc           string   `json:"service_documentation"`
		IntroEndpoint string   `json:"introspection_endpoint"`
		IntroAuth     []string `json:"introspection_endpoint_auth_methods_supported"`
		ISS           bool     `json:"authorization_response_iss_parameter_supported"`
	}{
		Issuer:        origin,
		AuthEndpoint:  aURL,


@@ 714,6 717,7 @@ func (s *Service) OAuthMetadata(c echo.Context) error {
		Doc:           s.config.DocumentationURL,
		IntroEndpoint: iURL,
		IntroAuth:     []string{"none"},
		ISS:           true,
	}
	return c.JSON(http.StatusOK, &ret)
}