Similar question asked about logging into Sandboxes with this error SFDX: Grant type not supported; here we look at logging into scratch orgs.
Given:
- In your CLI you want to log into a scratch org that your CLI did not create. In my case, it was a scratch org created by our dev ops tool - Gearset. But it could just as easily be a colleague's scratch org or one you created from a different computer.
When:
sfdx force:auth:web:login -r https://xxx-yyy-zzz-dev-ed.lightning.force.com -a someAlias
- Successfully brings up a login screen
- You enter username and password for that scratch org
- CLI displays error
grant type not supported
and browser displays localhost error