
Faujiya,
After working with Salesforce Support, I was able to fix my issue using this article (https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_cli_env_variables.htm) below. I am not sure we can assign a port, it will basically redirect back to 1717. On the article all you do is add a new Environment Variable as described at the bootom of the page on the article and it worked. Add Environment Variable NODE_TLS_REJECT_UNAUTHORIZED with a Value of 0Full link:https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_cli_env_variables.htmHope this helps ya.None of the solutions above work, nor should they be used.
Salesforce CLI is just broken,
So until Salesforce fix it use:
sfdx auth:device:login -a MyAlias -r https://<mydomain>--<sandbox>.my.salesforce.com -s
I had the same using custom domain login
The issue that I have was putting salesforce URL instead of my domain URL while "New Org" VC Code Command
Setup/My DomainYour domain name is: https://xxx-nzahorg-zxc--cscdev.my.salesforce.com
https://xxx-nzahorg-zxc--cscdev.lightning.force.com - salesforce org - wrong
https://xxx-nzahorg-zxc--cscdev.my.salesforce.com - mydomian - correctHi Lokesh Krishna Sagi,Authorize your org with a custom URL from VS code using salesforce's classic URL. It will definitely work.I hope it helps you. Kindly let me know if it helps you and close your query by marking it as solved.Thanks and Regards,Rahul Jangir
Hi Vishesh,Thank you for your reply. I had already tried that option but it didn;t work either. I got my chrome recently updated to 80 version and it was my default browser. I changed my default browser to IE and it started working for me. After almost 5 days, finally got it working by changing the default browser to IE. (it might work with Edge too, but I have not tried it).Regards,Faujiya Mandrupkar 1) vscode java.home is set with latest version.
2) Updated the port as below to some unused port in sfdx-project.json (Found in each project in the main directory)"oauthLocalPort": 19093)in new termina sfdx auth:web:login -r https://<MyDomainName>--<SandboxName>.sandbox.my.salesforce.com4) This will take to authorization after sucessful login. see if the oAuth redirect URL has the same port as the one mentioned in "oauthLocalPort" in sfdx-project.json , if not just replace the port in the URL with the one mentioned in the sfdx-project.json and hit the URL again and Authorization Sucessful if not take leave for today :)
WINDOWS PC Only... (don't use taskmanager!)
Using VSCode, open a new "cmd" terminal
OR Using Command Prompt for Windows (Click start, type "cmd" press enter)
1) c:\ netstat -ano | findstr :1717
-a = Displays all connections and listening ports.-n = Displays addresses and port numbers in numerical form.-o = Displays the owning process ID associated with each connection.2) c:\ taskkill /PID [YOUR PID] /F/F = Specifies to forcefully terminate the process(es).3) Press F1 and do SFDX: Authorize an Org. Wait for the CLI to pop up and ask questions, don't interrupt it. Name your connection and GO! It should work now. Note about sfdx_project.json:I recommend using your mydomain name for the sfdcLoginUrl in the sfdx-project.json file. Just make sure you get it from Classic, not Lightning. It should look like this: "sfdcLoginUrl": "https://corpadefakeo-sandbox1.my.salesforce.com".
@Rahul Jangir 2's solution of using the Classic URL did the trick for me. Thanks Rahul Hi people, I can resolve this problem uninstall the "Salesforce CLI" on control panel, and after this I install again, I hope this resolve the problem of everyone, I passed all my day trying to resolve this problem, this is really hard.... tks for all the help. bye. I hope it helps you.
1 . JAVAHOME set
2. Run command in the terminal sfdx plugins:install @salesforce/plugin-auth@1.4.33. Run command in the terminal sfdx auth:web:login --setalias myOrg --instanceurl https://login.salesforce.com --setdefaultusername