function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Scott MoranScott Moran 

SFDX: Authorize an Org hangs after login attempt

All,

I am on a Windows 10 laptop with the latest patches and updates from Microsoft Version 10.0.18363. When I attempt to Authorize an Org it opens Google Chrome Version 88.0.4324.190 (Official Build) (64-bit). I login using the login I've been using successfully since yesterday, I get the prompt to Allow Access, and it just hangs. I am currently running VS Code Version: 1.53.2. I have the Salesforce Extension Pack v51.2.0, and the same for the Salesforce CLI Integration.
I'm using sfdcLoginUrl = https://test.salesforce.com
When I execute the Authorize an Org it sends me to the following URL provided I have Revoked the previous attempt: https://<my_org_name>/setup/secur/RemoteAccessAuthorizationPage.apexp?source="very long string"

1. I am unable to find port 1717 running using suggestions previously mentioned.
2. I have uninstalled VS Code twice and deleted everything the second time before re-installing.
3. I have switched the Default browser to Edge each time and this doesn't work. I even tried IE once!!
4. I look for node.js running and if I kill that process the web browser immediately throws me into the unable to open local port 1717.
5. I've tried sfdx auth:web:login instead of sfdx force:auth:web:login and this does not work.
6. After the failed attempts I Revoke the Salesforce CLI found under my login ID.
7. In my troubleshooting I've seen OAuth Error
8. I have set the Google Chrome to run in Windows 8 compatibility mode as well. This doesn't help either.
9. I added the C:\Windows\System32 to the PATH environment variable as well.

What am I missing here. Can someone please advise?
Thank you.
SwethaSwetha (Salesforce Developers) 
HI Scott,
I see you also reached out on https://salesforce.stackexchange.com/questions/335392/sfdx-authorize-an-org-hangs-after-login-attempt

I have tried with sfdx auth:device:login -r https://test.salesforce.com and it works and redirects me to the sandbox

Can you try updating the version of SFDX using "sfdx update" as suggested to see if that fixes the issue.(Related:https://salesforce.stackexchange.com/questions/270606/can-not-update-sfdx)

Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful. Thank you
Scott MoranScott Moran

Swetha, thank you for the reply.  I did perform the update and it didn't fix it.  I stioll have the same issue.  I tried the sfdx auth:device:login -r https://test.salesforce.com again, however, I still get the following error message:

 sfdx auth:device:login -r https://test.salesforce.com
ERROR running auth:device:login:  Value is not an string

Scott Nelson SolutionistScott Nelson Solutionist
I am having the same problem. It worked for a while after uninstalling and re-installing CLI and then stopped working again.
Scott Nelson SolutionistScott Nelson Solutionist
Update: Using auth:device:login and adding an alias works, though really need sfdx force:auth:web:login --setalias [ALIAS] --instanceurl [MY DOMAIN URL] working again for regular use.