Skip to content
Snippets Groups Projects
Commit 6bb6d448 authored by Hugo NOUTS's avatar Hugo NOUTS
Browse files

scope causes 400

parent ef402b48
No related branches found
No related tags found
No related merge requests found
Pipeline #7781 passed
......@@ -453,18 +453,21 @@ func main() {
data.Set("grant_type", grantType)
data.Set("redirect_uri", redirectUri)
if grantType == "authorization_code" {
log.Info("grantType is authorization code")
data.Set("code", code)
} else {
} else if grantType == "client_credentials" {
log.Info("grantType is client_credentials")
data.Set("scope", scope)
}
log.Debug("data sent is : ", data)
log.Debug("Send request to token endpoint: ", tokenUrl)
http.DefaultTransport.(*http.Transport).TLSClientConfig = &tls.Config{InsecureSkipVerify: true}
response, err := http.PostForm(tokenUrl, data)
if err != nil {
log.Error(err)
} else {
log.Debug("Endpoint response with status", response.Status)
log.Debug("Endpoint response with status", response.Status, response)
defer response.Body.Close()
if response.StatusCode >= 200 && response.StatusCode <= 299 {
// Set Content-Type in response header
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment