I am attempting to setup VS Code with Salesforce CLI. I am experiencing issues when attempting to authorize my Sandbox.

When I attempt to authorize, I enter the MyDomain login page address and set my Alias.

VS Launches the CLI, the CLI opens my browser, I enter my login information, and click login. It attempts to redirect to the RemoteAccessAuthorizationPage.apexp page, bbut instead of routing to the OAuth Approval page I just wait. The browser says: "Waiting for localhost..." and then the whole thing times out.

I am behind a firewall, but I have configured by HTTP_PROXY and my HTTPS_PROXY.

I am fairly certain that the issue is a configuration setting, but I have no idea which one.

11:04:01.101 sfdx force:auth:web:login --setalias notifSandbox --instanceurl https://test.salesforce.com --setdefaultusername
11:04:34.562 sfdx force:auth:web:login --setalias notifSandbox --instanceurl  https://test.salesforce.com --setdefaultusername ended with exit code 1

Are you using some VPN service this usually happens when you are connected to VPN and try to authenticate and during redirect it throws error

Try following commands

1.Create a prject using force:orject
 a.sfdx force:project:create --projectname <Your project name> --outputdir <Path of file to be stored in hdd>
 b.sfdx force:project:create --projectname SOAP --outputdir c:\Users\syedfurx\Documents\VSCODE\SOAP

 a.sfdx force:auth:web:login --setalias <anydesiredname> --instanceurl https://<test/login>.salesforce.com --setdefaultusername
 b.sfdx force:auth:web:login --setalias litningpoc --instanceurl https://test.salesforce.com --setdefaultusername


  • I am following the 2.a. authorization pattern. But it gets stuck in a "Waiting for localhost..." redirect. I am looking for what setting I need to correct. See edit to my original question for output from VS Code. – Rob Davis Mar 19 at 3:06
  • I Believe this is because of the firewall/VPN. During authentication can you disable it and authenticate after that you may reconnect to firewall it should work as expected. After authentication make sure to make it as default org so that you need not to authenticate again – Syed Furqan Mar 25 at 6:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.