oauth2 icon indicating copy to clipboard operation
oauth2 copied to clipboard

No option to set Basic auth clientcredentials in the token request

Open prakashettigar opened this issue 5 years ago • 1 comments

I am no finding way to set basic auth in the token request Here is the sample CURL req

curl --location --request POST 'https://<domain.com>/OAuthToken/as/token.oauth2'
--header 'Authorization: Basic <Basic auth>'
--header 'Content-Type: application/x-www-form-urlencoded'
--data-urlencode 'client_id=<client_id>'
--data-urlencode 'client_secret=<client_secret>'
--data-urlencode 'grant_type=client_credentials'

How can I create token req in golang/oauth2/clientcredentials with Basic auth

https://github.com/golang/oauth2/tree/master/clientcredentials

prakashettigar avatar Oct 29 '20 04:10 prakashettigar

@prakashettigar You really don't need to set authorization headers when requesting oauth2 tokens . They are rather needed when you want to access resources on the resource server . Additionally ,check out https://github.com/golang/oauth2/blob/master/oauth2.go on how to use the PasswordCredentials grant type to convert a resource owner username and password pair into a token.

antwigambrah avatar Nov 09 '20 05:11 antwigambrah