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.