19

I'm trying to log in to an existing sandbox using the sfdx force:auth:web:login, which takes me to the login screen, I enter the password and email and I allow access, however in the browser I get a message: localhost didn't send any data, while in my CLI the message is ERROR: grant type not supported.

These are the requested permissions:

  • Access your basic information
  • Provide access to your data via the Web
  • Access and manage your data
  • Perform requests on your behalf at any time
22

The problem was that I was using the domain name instead of the plain test.salesforce.com.

This doesn't work:

sfdx force:auth:web:login -r https://xyz.lightning.force.com/ -a XYZ

but this works:

sfdx force:auth:web:login -r https://test.salesforce.com/ -a XYZ
| improve this answer | |
  • You certainly saved me some pain. Thx. – Dizzley Jan 9 at 11:49
  • Wow, just wow. Yes this works. Why it isn't documented, who knows? – Shane Jul 23 at 17:31
12

@smukov is correct, don't use the lightning.force.com url. Instead find that url here for your sandbox and log in using the instance that shows in the url during Log In or in the sandbox "location" column.

enter image description here

| improve this answer | |
  • this is the correct answer. – Cloxure Apr 9 '19 at 16:11
  • As noted in another answer, you can also use *.my.salesforce.com urls; these are easily derived from *.lightning.force.com urls: just replace "lightning.force.com" with "my.salesforce.com". Works for prod and sandbox urls. – Jason Clark Jun 16 at 17:48
9

The fix for me was to use the URL that the dev org redirected to after logout.

So I:

  1. Logged into the dev org
  2. Logged out of the dev org
  3. Copied the URL
  4. Executed this command in the terminal:

    sfdx force:auth:web:login -r https://random-domain-somenumber.my.salesforce.com -a DevHub

That did the trick for me

| improve this answer | |
  • Thank you, that did it for me as well...Been stuck for hours. – Arthlete Jul 29 '19 at 6:02
  • Thanks! I didn't have access to my production org at the time so this helped me get in – Jacob Raccuia Jan 6 at 15:21
7

Additionally, ensure you use "https" and not "http" (as I did)

"http" caused successful login on web resulting in following error ERROR: grant type not supported.

"https" solved it.

so, use "https://test.salesforce.com" and not "http://test.salesforce.com" (at least didn't worked for me).

| improve this answer | |
0

I was trying to Authorize my Org and got below message:

ERROR running force:auth:web:login:  grant type not supported

I am running windows 10 and when I turned off my firewall and tried again the authorization worked.

I hope that helps someone.

| improve this answer | |
0

I got this problem while trying to authorize while doing trailhead challenges so there is no production, and test.salesforce.com somehow is not working.

If you are already logged in and don't want to log out to get the domain info, you can use Domains section from Setup menu and get the info from there to authorize your org.

enter image description here

enter image description here enter image description here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.