This is most likely not an error with the salesforce cli

low angle view of office building against sky
Reading Time: < 1 minutes

Let say you want to execute this command using Salesforce CLI:

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

This error is shown

ERROR running auth:web:login: Invalid client credentials. Verify the OAuth client secret and ID. Error authenticating with auth code due to: grant type not supported

Error authenticating with auth code due to: grant type not supported. This is most likely not an error with the Salesforce CLI. Please ensure all information is accurate and try again.

The issue 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

Photo by Elisa Ventur on Unsplash


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: