diff --git a/main.go b/main.go index be2217863dc880fe373f43976fbd428adb4774f2..6d77f9c528b07960d2d4ed4ccf6665fa0c6b6f11 100644 --- a/main.go +++ b/main.go @@ -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