2

I have been using VS Code and Salesforce since a year in my company laptop.

I am trying to authorize VS code with my sandbox.

Process I followed:

  • VS Code> Sfdx auth org shortcut
  • Also tried sfdx force:auth:web:login --setalias SFDev --instanceurl https://test.salesforce.com --setdefaultusername

Every time I get below error in browser:

Error authenticating with auth code due to: request to https://test.salesforce.com//services/oauth2/token failed, reason: unable to get local issuer certificate

This is most likely not an error with the Salesforce CLI. Please ensure all information is accurate and try again.

And below error on VS code:

ERROR running auth:web:login: Invalid client credentials. Verify the OAuth client secret and ID. Error authenticating with auth code due to: request to https://test.salesforce.com//services/oauth2/token failed, reason: unable to get local issuer certificate

Tried some ways like NODE_TLS_REJECT_UNAUTHORIZED = 0 and Clearing cookies and caches. or Reinstalling CLI.

Nothing works so far. have been struggling from some time. Please help out.

2 Answers 2

1

Had the same issue, use this command instead:

sfdx auth:web:login --setalias SFDev --instanceurl https://test.salesforce.com

Note that instead of force:auth:web:login I use auth:web:login

1
  • 1
    The new command way since sf commands came out is sf org login web --instanceurl https://test.salesforce.com
    – compski
    Commented May 20 at 8:18
0

I had this error just now.

I just resolved it by deactivating the company's VPN then re-authorizing via VSCode

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .