Added print for the authorization code callback

This commit is contained in:
David J. Allen 2024-02-22 08:38:29 -07:00
parent 08ff9ee9e5
commit 7114073441
No known key found for this signature in database
GPG key ID: 717C593FF60A2ACC

View file

@ -14,15 +14,16 @@ func WaitForAuthorizationCode(host string, port int) (string, error) {
s := &http.Server{
Addr: fmt.Sprintf("%s:%d", host, port),
}
http.HandleFunc("/oauth/callback", func(w http.ResponseWriter, r *http.Request) {
http.HandleFunc("/oidc/callback", func(w http.ResponseWriter, r *http.Request) {
// get the code from the OIDC provider
if r != nil {
code = r.URL.Query().Get("code")
fmt.Printf("Authorization Code: %v\n", code)
fmt.Printf("authorization code: %v\n", code)
}
s.Close()
})
fmt.Printf("listening for authorization code at %s/oidc/callback\n", s.Addr)
return code, s.ListenAndServe()
}