Changed the IDP oauth endpoints to oauth2

This commit is contained in:
David J. Allen 2024-04-30 12:45:02 -06:00
parent 2edc624c01
commit bc5e693425
No known key found for this signature in database
GPG key ID: 717C593FF60A2ACC

View file

@ -173,7 +173,7 @@ func (s *Server) StartIdentityProvider() error {
http.Redirect(w, r, "/browser/login", http.StatusUnauthorized) http.Redirect(w, r, "/browser/login", http.StatusUnauthorized)
} }
}) })
r.HandleFunc("/oauth/token", func(w http.ResponseWriter, r *http.Request) { r.HandleFunc("/oauth2/token", func(w http.ResponseWriter, r *http.Request) {
r.ParseForm() r.ParseForm()
// check for authorization code and make sure it's valid // check for authorization code and make sure it's valid
@ -247,7 +247,7 @@ func (s *Server) StartIdentityProvider() error {
fmt.Printf("bearer: %s\n", string(b)) fmt.Printf("bearer: %s\n", string(b))
w.Write(b) w.Write(b)
}) })
r.HandleFunc("/oauth/authorize", func(w http.ResponseWriter, r *http.Request) { r.HandleFunc("/oauth2/authorize", func(w http.ResponseWriter, r *http.Request) {
var ( var (
responseType = r.URL.Query().Get("response_type") responseType = r.URL.Query().Get("response_type")
clientId = r.URL.Query().Get("client_id") clientId = r.URL.Query().Get("client_id")