I'm trying to authorize an org locally, and with the sfdx force:auth:web:login command my web browser pops up and I successfully log in with my credentials. But then, when calling the node localhost app to recover the access token, the service does not work. The browser is stuck on "Waiting for localhost...".

It has been a while since this is happening with my machine. I was using the sfdx force:auth:device:login way of authorizing instead, but now when I try this one, I get another error:

ERROR running auth:device:login: Value is not a string

That's because I'm specifying the sandbox URL (https://test.salesforce.com/). When the -r|--instanceurl parameter is not present in the command, it works. But it is necessary if I want to authorize a sandbox.

The first one seems a local/permission issue on Linux machines (I have never seen anyone else with this problem on macOS or Windows). The second one seems like a bug on the CLI.

Is there anything I can do other than using another OS?

  1. Running with sudo does not work.
  2. Allowing port 1717 on UFW does not work.
  3. Trying 1 and 2 at the same time does not work.
  4. Using the version installed on the project's folder instead of the globally installed one does not work.
  • sfdx force:auth:device:login -r https ://test.salesforce.com - remove space
    – Pavlo M
    Commented Jan 15, 2021 at 13:06
  • This issue appears to be discussed since December 14th, on GitHub. Commented Feb 1, 2021 at 11:25

4 Answers 4


I was able to login from windows, but every time I tried from Linux, for some reason it stops at waiting for localhost.

sfdx force:auth:device:login -r https://login.salesforce.com

This worked for me, to authorize my developer org.


I face the same same issues running the cli in Linux.

For me what worked was the following workaround:

$ export SFDX_INSTANCE_URL=https://test.salesforce.com

$ sfdx force:auth:device:login

=== Action Required! Enter 4VJV5RJQ user code in the verification URL https://test.salesforce.com/setup/connect


I've faced the same issue. Installation actual version of auth plugin helped me https://www.npmjs.com/package/@salesforce/plugin-auth


This has been confirmed to be a bug in the CLI. And it was fixed on version 7.91+.

You must log in to answer this question.

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