SFDX: Grant type not supported

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


Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

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

Method 2

@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

Method 3

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

Method 4

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

Method 5

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.

SFDX: Grant type not supported

SFDX: Grant type not supported
SFDX: Grant type not supported

Method 6

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.

All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Notify of

Inline Feedbacks
View all comments
Would love your thoughts, please comment.x