basic auth for /oauth/token
scne opened this issue · 3 comments
scne commented
Hi guys,
my /oauth/token
is under basic auth. How use this library in this situation? I get this error
{"error":"unauthorized","error_description":"Full authentication is required to access this resource"}
If I call wiht cUrl with curl -X POST -vu xxxxxxx:yyyyyyyy http://127.0.0.1:8383/oauth2/token ......
baster33 commented
You need to set Authorization header for example like this:
this.authOptions = {
headers: {
Authorization: 'Basic ' + authdata,
'Content-Type': 'application/x-www-form-urlencoded'
}
};
And then just call getAccessToken
with options:
this.OAuth.getAccessToken(user, this.authOptions)
mcun0s commented