question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error unsupported_grant_type when login

See original GitHub issue

I’ve tried tutorial from this website --> https://jsforce.github.io/ however, whenever I tried to login, I got an error ‘unsupported_grant_type’ as following: { unsupported_grant_type: grant type not supported at C:\Users\lusiana.wijayanti\Documents\mycustomapp\app\api\node_modules\jsforce\lib\oauth2.js:195:19 at tryCallOne (C:\Users\lusiana.wijayanti\Documents\mycustomapp\app\api\node_modules\promise\lib\core.js:37:12) at C:\Users\lusiana.wijayanti\Documents\mycustomapp\app\api\node_modules\promise\lib\core.js:123:15 at flush (C:\Users\lusiana.wijayanti\Documents\mycustomapp\app\api\node_modules\asap\raw.js:50:29) at _combinedTickCallback (internal/process/next_tick.js:73:7) at process._tickCallback (internal/process/next_tick.js:104:9) name: 'unsupported_grant_type' }

Does anyone ever come across the same issue? If yes, some advice will be very helpful.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:14

github_iconTop GitHub Comments

4reactions
photzcommented, Oct 15, 2019

I’ve seen this error for the first time today when trying to connect my app with a client’s Sandbox org. What fixed it in my case was using https://test.salesforce.com as the login URL.

0reactions
Myrko-SMcommented, Jan 25, 2021

You can try to remove the loginUrl param from the oAuth connection options, worked for me:

SALESFORCE_OAUTH: new jsforce.OAuth2({ // loginUrl : process.env.SALESFORCE_LOGIN_URL, clientId : process.env.SALESFORCE_CONSUMER_KEY, clientSecret : process.env.SALESFORCE_CONSUMER_SECRET, redirectUri : process.env.SALESFORCE_OAUTH_REDIRECT })

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting "error": "unsupported_grant_type" when trying to get a ...
Another common cause of this 'unsupported_grant_type' error is calling the API as GET instead of POST.
Read more >
Getting unsupported_grant_type error on POSTMAN and ...
I tried adding the Content-Type parameter as well, but does not work. Kindly help! but this does not work in POSTman or Adv...
Read more >
Why am I getting an unsupported_grant_type error?
No matter how I mishape the validation request, I continue to get a 400 response with an "unsupported_grant_type" error. The docs say that...
Read more >
"unsupported_grant_type" error when trying to authenticate
Looking at the request in Fiddler, I noticed that the headers and body that I set using RestSharp with the code above were...
Read more >
[Google Services OAuth2] Error "unsupported_grant_type ...
Hi all,. I'm trying integrate to the Google Services OAuth2 component, but, I'm having some troubles exchanging the code (that it's received in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found