error authenticating with auth code due to: grant type not supported

woman looking through tower viewer
Reading Time: < 1 minutes

You are trying to log in through an instance URL (example: sandbox) and you do this.

      
sfdx auth:web:login -a myusername@myorg.sandbox --instanceurl=https://mysandbox-domain.lightning.force.com

And you get this error in console:

In your browser you get this

image

The problem is you are using lightning.force.com domain instead of my.salesforce.com

      
sfdx auth:web:login -a myusername@myorg.sandbox --instanceurl=https://mysandbox-domain.my.salesforce.com


About the author

Andrés Canavesi
Andrés Canavesi

Software Engineer with 15+ experience in software development, specialized in Salesforce, Java and Node.js.


Related posts


Leave a Reply

%d bloggers like this: