force-server
force-server copied to clipboard
oauth token refresh call failing (HTTP form POST proxying does not work)
As documented here, In order to get a new access_token, I need to make a regular form-submission type POST request (Content-Type: application/x-www-form-urlencoded)
However when using this proxy the POST body does not seem to reach the endpoint. No matter what data I pass in, the response is always {"error_description":"grant type not supported","error":"unsupported_grant_type"}
According to this line https://github.com/ccoenraets/force-server/blob/master/server.js#L45
It looks like the proxy server assumes that every request body is in JSON format, which is not the case for this OAuth API.
Yep, I'm getting the same error. What's weird is that if I use cURL, I get a response just fine, but for some reason when I go through a proxy (which is required because I can't get CORS whitelisting to work), I always get the "unsupported_grant_type" error.
I have a relevant StackOverflow question posted here, I may open a bounty on it soon: http://stackoverflow.com/questions/31736514/nodejs-proxy-not-working-as-intended