Skip to content

FDX: Authorize an Org hangs after login attempt #890

Closed
forcedotcom/sfdx-core
#384

Description

@kadantsam

All,

This all started last Wednesday, February 24 very late in the day. I have not been able to get connected to the Salesforce Sandbox since then. I have performed the sfdx update several times since and this has not helped. Can anyone help me. I have 4 LWC's that need to be published.

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"

I am unable to find port 1717 running using suggestions previously mentioned.
I have uninstalled VS Code twice and deleted everything the second time before re-installing.
I have switched the Default browser to Edge each time and this doesn't work. I even tried IE once!!
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.
I've tried sfdx auth:web:login instead of sfdx force:auth:web:login and this does not work.
After the failed attempts I Revoke the Salesforce CLI found under my login ID.
In my troubleshooting I've seen OAuth Error
I have set the Google Chrome to run in Windows 8 compatibility mode as well. This doesn't help either.
I added the C:\Windows\System32 to the PATH environment variable as well.
I also tried logging in with our Salesforce Admin credentials and that didn't work either.
What am I missing here. Can someone please advise?

Thank you.

Activity

  1. team-seavus commented on Mar 1, 2021

    @team-seavus

    forcedotcom/salesforcedx-vscode#2931

    This helped me: sfdx plugins:install [email protected]

  2. kadantsam commented on Mar 1, 2021

    @kadantsam
    Author

    Team-seavus,

    Thank you for the reply!! This did not work for me. To re-iterate, I attempt to "Authorize an Org" and it opens up Google Chrome and prompts me if it is okay for Access and click allow then it redirects me to the following URL and just hangs:

    https://{my org}.my.salesforce.com/_ui/identity/oauth/ui/AuthorizationPage

    Any help is greatly appreciated.

  3. team-seavus commented on Mar 1, 2021

    @team-seavus

    Team-seavus,

    Thank you for the reply!! This did not work for me. To re-iterate, I attempt to "Authorize an Org" and it opens up Google Chrome and prompts me if it is okay for Access and click allow then it redirects me to the following URL and just hangs:

    https://{my org}.my.salesforce.com/_ui/identity/oauth/ui/AuthorizationPage

    Any help is greatly appreciated.

    Sorry to hear that, my problem was very similar.
    Maybe you can try with different Browser or check the steps given here: forcedotcom/salesforcedx-vscode#2996 (uninstall->install).

  4. kadantsam commented on Mar 1, 2021

    @kadantsam
    Author

    Team-seavus,
    Thank you for the reply!! This did not work for me. To re-iterate, I attempt to "Authorize an Org" and it opens up Google Chrome and prompts me if it is okay for Access and click allow then it redirects me to the following URL and just hangs:
    https://{my org}.my.salesforce.com/_ui/identity/oauth/ui/AuthorizationPage
    Any help is greatly appreciated.

    Sorry to hear that, my problem was very similar.
    Maybe you can try with different Browser or check the steps given here: forcedotcom/salesforcedx-vscode#2996 (uninstall->install).

    Switched to Microsoft Edge and still no good. I've re-installed twice so far. Still NFG!!

    I just looked at the link you provided and I have the same values that the user reported when he re-installed, but this still does not work:

    Version: 1.53.2 (user setup)
    Commit: 622cb03f7e070a9670c94bae1a45d78d7181fbd4
    Date: 2021-02-11T11:48:04.245Z
    Electron: 11.2.1
    Chrome: 87.0.4280.141
    Node.js: 12.18.3
    V8: 8.7.220.31-electron.0
    OS: Windows_NT x64 10.0.18363

    BTW, one more note!! Raul suggested using the following command:

    // authorize production org
    sfdx auth:device:login

    The above worked to get me into the production server, however, when I try the following:

    // authorize sandbox
    sfdx auth:device:login -r https://test.salesforce.com

    I get the following error:
    "ERROR running auth:device:login: Value is not an string"

  5. ImJohnMDaniel commented on Mar 1, 2021

    @ImJohnMDaniel

    Some of my team have seen similar issues. We had to downgrade to 7.83 to get stable again.

  6. kadantsam commented on Mar 1, 2021

    @kadantsam
    Author

    Some of my team have seen similar issues. We had to downgrade to 7.83 to get stable again.

    ImJohnMDaniel, thank you very much for the suggestion. I will try this next and report on the my progress.

  7. kadantsam commented on Mar 1, 2021

    @kadantsam
    Author

    Some of my team have seen similar issues. We had to downgrade to 7.83 to get stable again.

    ImJohnMDaniel, thank you very much for the suggestion. I will try this next and report on the my progress.

    ImJohnMDaniel, I'm confused, what exactly did your team downgrade to 7.83? I presumed you were talking about the Salesforce CLI. Can you please provide a little more detail? Thanks.

  8. ImJohnMDaniel commented on Mar 1, 2021

    @ImJohnMDaniel

    All of the versions since 7.84 have been unstable in some manner. We are not bother to downgrade specific elements of the CLI as that can cause more chaos. My team saved the installation media for v7.83. We have uninstalled any version higher than that and have installed the 7.83 version. Most of the team are also using the environment variable SFDX_DISABLE_AUTOUPDATE (ref) to prevent automatic upgrades until the CLI gets stable again.

    FYI @amphro @clairebianchi

  9. kadantsam commented on Mar 1, 2021

    @kadantsam
    Author

    All of the versions since 7.84 have been unstable in some manner. We are not bother to downgrade specific elements of the CLI as that can cause more chaos. My team saved the installation media for v7.83. We have uninstalled any version higher than that and have installed the 7.83 version. Most of the team are also using the environment variable SFDX_DISABLE_AUTOUPDATE (ref) to prevent automatic upgrades until the CLI gets stable again.

    FYI @amphro @clairebianchi

    Thank you again for the information. I can't seem to find the version you are referencing. Do you have any idea how I can find that version?

  10. ImJohnMDaniel commented on Mar 1, 2021

    @ImJohnMDaniel

    We saved the installed from when it was originally released. Maybe @amphro or @clairebianchi know how to access v7.83 from the public

  11. kadantsam commented on Mar 1, 2021

    @kadantsam
    Author

    All,

    Thanks to ImJohnMDaniel I've got it fixed.

    1. Go to the following URL:
      https://marketplace.visualstudio.com/items?itemName=salesforce.salesforcedx-vscode
    2. Download an older version, I downloaded 50.16.0
    3. Uninstall any of the Salesforce extensions in VS Code
    4. Restart the VS Code and click on the Extensions, and the three dots at the top
    5. Then click on the Install from SVIX...
    6. And, point it to the file you just downloaded.
    7. I restarted VS Code to be on the safe side but I'm back up and running.
      Thank you everyone.
  12. qwikag commented on Mar 1, 2021

    @qwikag

    @kadantsam
    Sorry this did not work. (uninstall and DL the extensions)
    I followed your instruction to the letter.
    I uninstalled the visualforce extension (as per your instruction to uninstall any)then restarted.
    and I installed the downloaded verion as advised, it did nothing.
    SO I went a step further and uninstalled all Salesforce extensions and even removed the folders within my HOME folder.
    I then re-added the extension, and now it just tells me it is successful but does not open the browser at all and does not connect the org.

    To the developers
    This problem was resolved, once upon a time, but has come back again.
    PLEASE can you employ an Automated Testing regime to ensure you stop regressing code.

    I had this problem in a previous version. Now it is back
    I recently upgraded again due to a different issue with retrieval and deployment, and now this Auth issue is back.

  13. qwikag commented on Mar 1, 2021

    @qwikag

    Updated CLI from 7.88.4-3b2e55c3f1 to 7.89.2-d1d2614d02...
    NOTHING WORKS!

  14. qwikag commented on Mar 2, 2021

    @qwikag

    removed cli software via WIN10 REMOVE SOFTWARE Feature
    Reinstalled via Node
    Same problem, does not access localhost

    this is my setup:

    sfdx --version
    sfdx-cli/7.89.2 win32-x64 node-v14.16.0

    sfdx plugins
    no plugins installed

    sfdx plugins --core
    You acknowledge and agree that the CLI tool may collect usage information, user environment, and crash reports for the purposes of providing services or functions that are relevant to use of the CLI tool and product improvements.

    @oclif/plugin-autocomplete 0.3.0 (core)
    @oclif/plugin-commands 1.3.0 (core)
    @oclif/plugin-help 3.2.2 (core)
    @oclif/plugin-not-found 1.2.4 (core)
    @oclif/plugin-plugins 1.10.0 (core)
    @oclif/plugin-update 1.4.0-2 (core)
    @oclif/plugin-warn-if-update-available 1.7.0 (core)
    @oclif/plugin-which 1.0.3 (core)
    @salesforce/sfdx-trust 3.6.0 (core)
    alias 1.1.7 (core)
    auth 1.4.9 (core)
    config 1.2.5 (core)
    generator 1.1.5 (core)
    salesforcedx 51.1.1 (core)
    ├─ limits 1.0.4 (core)
    ├─ user 1.1.2 (core)
    ├─ schema 1.0.4 (core)
    ├─ templates 51.3.0 (core)
    ├─ custom-metadata 1.0.11 (core)
    ├─ apex 0.1.4 (core)
    ├─ salesforce-alm 51.1.1 (core)
    └─ @salesforce/sfdx-plugin-lwc-test 0.1.7 (core)
    sfdx-cli 7.89.2 (core)
    telemetry 1.1.1 (core)

  15. added
    bug
    on Mar 2, 2021
  16. 13 remaining items

  17. superkencodes commented on Mar 3, 2021

    @superkencodes

    Here is my work-around in case anyone is interested:

    type this in your ide's terminal:
    sfdx force:auth:device:login -r https://test.salesforce.com

    you will be prompted with a response similar to this:

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

    Click on the link and enter in the code, it will redirect you to the test.salesforce.com login page. From there just login to whatever sandbox you are trying to connect to your ide.

    This worked for me and bypassed the Authorization hang and invalid session id errors I was faced with.

  18. prudev commented on Mar 3, 2021

    @prudev

    I'm facing this issue to. I'm on Windows 10, VS Code version is 1.53.2, CLI version is sfdx-cli/7.89.2-d1d2614d02 win32-x64 node-v14.15.4.

    The device flow work-around worked for me also:
    sfdx force:auth:device:login -r https://test.salesforce.com

    Please let us know when auth:web:login is fixed.

  19. cgjerdingen commented on Mar 3, 2021

    @cgjerdingen

    Multiple developers here are having the same issue here at Carlson School. auth:device:login workaround mentioned by @superkencodes worked for us.

    Please let us know when this issue is resolved.

  20. tronic111 commented on Mar 3, 2021

    @tronic111

    This is impacting me as well. none of the suggestions are working for me

    Use this as a workaround for now:
    sfdx auth:device:login -a MyAlias -r https://mydomain--sandbox.my.salesforce.com -s

    I get:
    ERROR running auth:device:login: Value is not a string
    when trying to use the -r flag. Even against https://test.salesforce.com as suggested in their documentation

    I can confirm that this doesn't work. I had attempted it several times. There is something wrong with that option.

    After completely removing Salesforce CLI from my system and everything else I could find related to it and then reinstalling I was able to get:

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

    to work.

  21. JohnTheRedeemer commented on Mar 3, 2021

    @JohnTheRedeemer

    The sfdx force:auth:device:login worked for me, thanks for the workaround! Much less convenient than my normal worfklow, hopefully they fix this quick!

  22. shetzel commented on Mar 3, 2021

    @shetzel
    Contributor

    The fix was made in the @salesforce/core library for this and the @salesforce/plugin-auth plugin was updated (v1.4.10) to use that version. See this PR for details: forcedotcom/sfdx-core#384

    We want to thank and give credit to @hansalves for submitting the PR. We cherry-picked and merged his fix to get it into a release as soon as possible.

    There are some options for getting this fix.

    1. install sfdx-cli@latest-rc
    2. If you're already using latest-rc, update to the most recent version
    3. directly install the latest auth plugin. sfdx plugins:install @salesforce/plugin-auth. Just remember that you have it installed this way and are overriding the core version included with the CLI.
    4. latest-rc will be promoted to latest tomorrow so you could wait for that

    In the process of moving code to open source there have been some unfortunate regressions with several of the new OSS plugins, auth is one of them. As we move the code we do our best to improve it (some of it was written 6 years ago and needed updating) while maintaining stability and ensuring parity with the old plugin version with unit tests, integration tests, etc. We're human and mistakes are made despite our best efforts. We try to get these issues addressed as quickly as possible and very much appreciate the effort and understanding of everyone in the community.

  23. CatoCoder commented on Mar 4, 2021

    @CatoCoder

    Following

  24. qwikag commented on Mar 5, 2021

    @qwikag

    BTW: If anyone can explain the difference between the win10 download versus the Node install, please visit here to answer my question on Stackexchange. https://salesforce.stackexchange.com/questions/335932/how-do-i-best-switch-versions-of-sfdx-and-plugins

    All is well again for me. I am node connected.

    sfdx --version:
    sfdx-cli/7.90.2 win32-x64 node-v14.16.0
    sfdx plugins --core
    @oclif/plugin-autocomplete 0.3.0 (core)
    @oclif/plugin-commands 1.3.0 (core)
    @oclif/plugin-help 3.2.2 (core)
    @oclif/plugin-not-found 1.2.4 (core)
    @oclif/plugin-plugins 1.10.0 (core)
    @oclif/plugin-update 1.4.0-2 (core)
    @oclif/plugin-warn-if-update-available 1.7.0 (core)
    @oclif/plugin-which 1.0.3 (core)
    @salesforce/sfdx-trust 3.6.0 (core)
    alias 1.1.8 (core)
    auth 1.4.10 (core)
    config 1.2.6 (core)
    generator 1.1.5 (core)
    salesforcedx 51.2.2 (core)
    ├─ limits 1.0.4 (core)
    ├─ user 1.1.2 (core)
    ├─ schema 1.0.4 (core)
    ├─ apex 0.1.4 (core)
    ├─ custom-metadata 1.0.11 (core)
    ├─ templates 51.3.0 (core)
    ├─ @salesforce/sfdx-plugin-lwc-test 0.1.7 (core)
    └─ salesforce-alm 51.2.1 (core)
    sfdx-cli 7.90.2 (core)
    telemetry 1.1.1 (core)

  25. qwikag commented on Mar 5, 2021

    @qwikag

    Can someone advise what the fix was, and what it was related to.
    The reason I ask is because the bug showed itself when the browser was trying to connect to localhost, and that has device implications.
    So what was the general idea of the fix?

  26. hansalves commented on Mar 5, 2021

    @hansalves

    @qwikag This is the commit that fixes the bug.

    Basically the local server was created and set to listen to port 1717 but the event handler that processes the callback was only added if the server wasn't listening yet. Because of this, the handler was never added so the local server wouldn't do anything with the callback request and just hang.

  27. qwikag commented on Mar 5, 2021

    @qwikag

    @hansalves
    Thank you you for a concise answer that is great news!
    So it means there were no external factors, and all the suggestions from the masses of port changes and proxys settings and system environment variables etc, was pointless, they probably had a different issue.

  28. lukethacoder commented on Mar 6, 2021

    @lukethacoder

    @JohnTheRedeemer 's solution (using sfdx force:auth:device:login instead) seems to work nicely.

    if you need to auth a sandbox org use the -r https://test.salesforce.com flag on the end of the command. can add an alias using -a YOUR_ORG_ALIAS too.

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

    updating the sfdx-cli to version 7.90.2 has fixed this up.

  29. paustint commented on Mar 18, 2021

    @paustint

    I encounter this issue every morning and run sfdx force:org:list, which seems to refresh the tokens for all of my orgs at once, then it works until the next morning.

  30. SimonPerez98 commented on Mar 18, 2021

    @SimonPerez98

    i encounter the same issue Today with sfdx auth:web:login -d -a DevHub

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions