Skip to content

Commit

Permalink
Reverted token fetch in server
Browse files Browse the repository at this point in the history
  • Loading branch information
davidallendj committed Apr 26, 2024
1 parent 5825273 commit 447c9fb
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions internal/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,19 +212,19 @@ func (s *Server) StartLogin(clients []oauth.Client, params ServerParams) error {
http.Redirect(w, r, "/error", http.StatusInternalServerError)
return
}
} else {
// FIXME: I think this probably needs to reworked or removed
// NOTE: this logic fetches a token for services to retrieve like BSS
// perform a client credentials grant and return a token
var err error
accessToken, err = flows.NewClientCredentialsFlow(params.ClientCredentialsEndpoints, params.ClientCredentialsParams)
if err != nil {
fmt.Printf("failed to perform client credentials flow: %v\n", err)
http.Redirect(w, r, "/error", http.StatusInternalServerError)
return
}
w.Write([]byte(accessToken))
}
// FIXME: I think this probably needs to reworked or removed
// else {
// // perform a client credentials grant and return a token
// var err error
// accessToken, err = flows.NewClientCredentialsFlow(params.ClientCredentialsEndpoints, params.ClientCredentialsParams)
// if err != nil {
// fmt.Printf("failed to perform client credentials flow: %v\n", err)
// http.Redirect(w, r, "/error", http.StatusInternalServerError)
// return
// }
// w.Write([]byte(accessToken))
// }
})
r.HandleFunc(callback, func(w http.ResponseWriter, r *http.Request) {
// get the code from the OIDC provider
Expand Down

0 comments on commit 447c9fb

Please # to comment.