13

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
17

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
10

@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

  • this is the correct answer. – Cloxure Apr 9 at 16:11
5

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 at 6:02
2

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

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.