Reverted token fetch in server

This commit is contained in:
David J. Allen 2024-04-26 15:56:25 -06:00
parent 5825273f0c
commit 447c9fb5e9
No known key found for this signature in database
GPG key ID: 717C593FF60A2ACC

View file

@ -212,19 +212,19 @@ func (s *Server) StartLogin(clients []oauth.Client, params ServerParams) error {
http.Redirect(w, r, "/error", http.StatusInternalServerError) http.Redirect(w, r, "/error", http.StatusInternalServerError)
return return
} }
} } else {
// FIXME: I think this probably needs to reworked or removed // FIXME: I think this probably needs to reworked or removed
// else { // NOTE: this logic fetches a token for services to retrieve like BSS
// // perform a client credentials grant and return a token // perform a client credentials grant and return a token
// var err error var err error
// accessToken, err = flows.NewClientCredentialsFlow(params.ClientCredentialsEndpoints, params.ClientCredentialsParams) accessToken, err = flows.NewClientCredentialsFlow(params.ClientCredentialsEndpoints, params.ClientCredentialsParams)
// if err != nil { if err != nil {
// fmt.Printf("failed to perform client credentials flow: %v\n", err) fmt.Printf("failed to perform client credentials flow: %v\n", err)
// http.Redirect(w, r, "/error", http.StatusInternalServerError) http.Redirect(w, r, "/error", http.StatusInternalServerError)
// return return
// } }
// w.Write([]byte(accessToken)) w.Write([]byte(accessToken))
// } }
}) })
r.HandleFunc(callback, func(w http.ResponseWriter, r *http.Request) { r.HandleFunc(callback, func(w http.ResponseWriter, r *http.Request) {
// get the code from the OIDC provider // get the code from the OIDC provider