You need to sign in to do that
Don't have an account?
Naresh2389
How to authicate SFDX with sandbox
sfdx force:auth:jwt:grant --instanceurl is failing to authenticate with sfdx and sandbox autheication.
SFDX Authentication is working fine for Scratch Org and DevHub Org but failing with Sanbox
SFDX Authentication is working fine for Scratch Org and DevHub Org but failing with Sanbox
Example:
$ sfdx force:auth:jwt:grant -u me@acme.org -f <path to jwt key file> -i <OAuth client id> -r https://acme.my.salesforce.com
ERROR running force:auth:jwt:grant: We encountered a JSON web token error, which is likely not an issue with Salesforce CLI. Here’s the error: client identifier invalid
-> Select the checkbox next to your Dev Hub username, then click Assign
https://salesforcerealm.com/2020/03/07/authenticate-sfdx-using-jwt/
* Refreshing/Cloning sandboxes generates a DIFFERENT Client ID in every sandbox in the Connected App when Cloned/Refreshed
* I found that using https://test.salesforce.com/ for the Login Url works with sandboxes (and not the vanity URL)
* note that your Username is different in every sandbox
Taking these things into consideration, I've had no issues logging into all our sandboxes and production, only changing the Client ID, Username, and Login URL.