OAuth2 password flow sends token request incorrectly
See original GitHub issueSeems that at least when using Resource owner password credentials flow for authentication, token request is sent incorrectly. Currently code on master sends is like this (/src/core/plugins/auth/actions.js)
let req = {
url: schema.get("tokenUrl"),
method: "post",
headers: {
"content-type": "application/x-www-form-urlencoded"
},
query: {
grant_type: "password",
username,
password,
scopes: encodeURIComponent(auth.scopes.join(scopeSeparator))
}
}
This means that all parameters are sent as query parameters not as part of body as spec defines (https://tools.ietf.org/html/rfc6749#section-4.3.2).
it could use instead body: new FormData(...) of query: {...}
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
OAuth 2.0 Username-Password Flow Problem
This defeats process of authentication through oauth.You can ask the user to enter crendentials himself and then store oauth token somewhere in ...
Read more >Why I have an error performing password flow when I login?
It seems like your Token Endpoint is configured to use a different Authentication Method. There is an error shown invalid_client , it looks ......
Read more >OAuth 2.0 Authorization Errors - Salesforce Help
Errors can occur during OAuth authorization. For example, a user denies access to the connected app or request parameters are incorrect.
Read more >The Authorization Response - OAuth 2.0 Simplified
redirect_uri – The redirect URL that was used. This needs to be stored since the access token request must contain the same redirect...
Read more >Confusing error message on failed refresh token request
Can you share the request you are sending when you got that error message. When you use V2 endpoint , it is mandatory...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I am also facing this problem. There is a configuration for sending client credentials; whether to send it as Basic header or in body. But there is no configuration available for sending payload data. Nevertheless, according to the spec, payload should be sent as URL encoded POST payload. So I think, this needs to be fixed.
@jniemin thanks for your cooperation