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

7 Answers 7


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

@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

  • 1
    this is the correct answer.
    – Cloxure
    Apr 9, 2019 at 16:11
  • 5
    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. Jun 16, 2020 at 17:48
  • Thanks for the answer @JasonClark, this worked
    – Sree
    Oct 7, 2020 at 20:09

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

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

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).

  • This. CLI example shows http instead of https.
    – dzh
    Mar 2, 2023 at 22:47

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


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.


I got this recently when I had a / at the end of the url so I was using https://blablabla.sandbox.my.salesforce.com/ and I had to use https://blablabla.sandbox.my.salesforce.com

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .