SFDX: Grant type not supported
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.
The fix for me was to use the URL that the dev org redirected to after logout.
So I:
- Logged into the dev org
- Logged out of the dev org
- Copied the URL
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