Salesforce Interview Questions & Answers Book is now available!

Grab Now

Tips

sfdx force:jwt:grant unable to authenticate

How to fix sfdx force:jwt:grant unable to authenticate issue.

By Teja, ex-Salesforce engineer · Updated March 5, 2021 · 1 min read

When you try to login to your sandbox using SFDX at times you might comes across this error which is ...

sfdx force:jwt:grant unable to authenticate

The fix is simple though, you need to run this command in your terminal (if you are using a mac)

export SFDX_AUDIENCE_URL=https://test.salesforce.com

Run this command in Terminal

Which basically means that you are looking forward to get authenticated against a sandbox and not Developer Org or Production Org.

If you are using Visual Studio Code you can also make some changes to the sfdx-project.json file to get around this problem.

  1. Open the project and go to sfdx-project.json file
  2. Change sfdcLoginUrl from https://login.salesforce.com to https://test.salesforce.com
  3. Authorize your org

Hope this help!

Learn it by building it

Every course, every code repository, the discussion group and certificates of completion — one subscription.

Keep me in the loop!

Email me when a new episode is published (promise, I will not spam you)

You're signing up to receive emails from Salesforce Casts