Repository navigation
Description
Summary
After running sfdx force:auth:web:login command and entering username and password, the confirmation does not appear where the CLI has successfully authorised. Instead, an OAuth error appears on the screen.
This is the same behaviour when using the VSCode Extensions using the VSCode UI.
Steps To Reproduce:
Repository to reproduce: Not applicable
NOTE: If your issue is not reproducable by dreamhouse-lwc, i.e. requires specific metadata or files, we require a link to a simple Salesforce project repository with a script to setup a scratch org that reproduces your problem.
- Run command: sfdx force:auth:web:login --setalias MyOrgAlias --instanceurl https://test.salesforce.com --setdefaultusername
- Enter Username and Password on the browser
- The screen waits for a response and tries to log you in
- Refresh browser screen and you will get an OAuth error.
Try above steps using the sfdx auth:web:login command and there are no issues.
UPDATE 2021/03/01: sfdx auth:web:login command is not working as well - tried this on a production URL https://login.salesforce.com
Expected result
SFDX via VSCode extensions will be authorised into the target org.
Actual result
OAuth error received if using the sfdx force:auth:web:login command
UPDATE 2021/03/01: sfdx auth:web:login command is not working as well - tried this on a production URL https://login.salesforce.com
SFDX CLI Version(to find the version of the CLI engine run sfdx --version):
$ sfdx --version
sfdx-cli/7.86.3 win32-x64 node-v14.15.3
SFDX plugin Version(to find the version of the CLI plugin run sfdx plugins --core)
$ sfdx plugins --core
@oclif/plugin-autocomplete 0.1.5 (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.9.5 (core)
@oclif/plugin-update 1.3.10 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/sfdx-diff 0.0.6
@salesforce/sfdx-trust 3.6.0 (core)
alias 1.1.5 (core)
analytics 1.12.1 (core)
auth 1.4.7 (core)
config 1.2.4 (core)
etcopydata 0.5.7
generator 1.1.5 (core)
salesforcedx 50.16.1 (core)
├─ schema 1.0.3 (core)
├─ limits 1.0.3 (core)
├─ user 1.0.11 (core)
├─ custom-metadata 1.0.11 (core)
├─ apex 0.1.4 (core)
├─ templates 50.4.0 (core)
├─ @salesforce/sfdx-plugin-lwc-test 0.1.7 (core)
└─ salesforce-alm 50.16.1 (core)
sfdx-cli 7.86.3 (core)
sfdx-git-delta 4.2.0
telemetry 1.0.1 (core)
OS and version: Windows 10 Enterprise
Activity
github-actions commentedon Feb 22, 2021
Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support.
[-]sfdx force:auth:web:login not working (also via VSCode extensions) but sfdx auth:web:login is[/-][+]sfdx force:auth:web:login not working (also via VSCode extensions) but sfdx auth:web:login is working[/+]dhbahr commentedon Feb 23, 2021
I can also confirm the issue, downgrading to 7.26.0 solves it.
torynet commentedon Feb 23, 2021
Same problem for multiple members of my team after updating from 7.85 to 7.88, except that no version of the command line seems to resolve it.
Ticket in with support, but in the meantime I will attempt to downgrade. I would like to see if I can find something less drastic than 7.26.0 from a year ago. Downgrading back to 7.85 did not resolve it. Perhaps it's an issue with a dependency... Also my lone mac user updated to 7.88 and has seen no problem.
AngelMtz97 commentedon Feb 24, 2021
I have the same issue, it keeps loading in Ubuntu
sfdx-cli/7.85.1-2fb9e41053 linux-x64 node-v12.18.3
Visual Code:
Version: 1.53.2
Commit: 622cb03f7e070a9670c94bae1a45d78d7181fbd4
Date: 2021-02-11T11:48:44.518Z
Electron: 11.2.1
Chrome: 87.0.4280.141
Node.js: 12.18.3
V8: 8.7.220.31-electron.0
OS: Linux x64 5.4.0-66-generic snap
torynet commentedon Feb 24, 2021
hmm... No level of downgrading or even fully uninstalling and reinstalling an older version from NPM has been able to change the behavior for us.
Frankly the "downgrade" procedure I read didn't seem to work. Telling it to install the plugin of a particular version would seem to work, but then if you did "sfdx -v" it would still just say 7.88.4.
dhbahr commentedon Feb 24, 2021
Really? Not even the oldy but goody 7.26.3? Truth be told I did not put too much effort on finding the most recent working version, but 7.26.3 really came through for me.
Yeah, my mac user colleagues also don't seem to be affected.
I can also confirm that 7.88.4 does not solve it for me.
Also, I just realized the original reporter claims the cli does work for him, I just want to state for the record: it does not for me. I don't believe this to be related to VSCode at all, but to
sfdx-cliitself.dhbahr commentedon Feb 24, 2021
BTW, as per forcedotcom/salesforcedx-vscode#2931 (comment) maybe try downgrading the salesforcedx plugin directly.
torynet commentedon Feb 25, 2021
@dhbahr Well, we have had some other troubles with various versions that I didn't want to re-experience, so I was loathe to go back too far. Now that you mention it though, I don't think that I actually tested 7.26.3, because I thought it was downgrading when it was not. I'll try it over again using NPM to downgrade when I can.
I did uninstall completely and install 7.85.1 (which is where I was before the update that caused the failure) from NPM in order to get the version I wanted. It did not seem to improve things at all.
Still happening now:
Hoping to eventually hear something helpful from support.
Since we're sharing:
torynet commentedon Feb 25, 2021
No such luck. Downgraded to 7.26.0 (that's all that was available for 7.26 on NPM), but still the very same result.
dhbahr commentedon Feb 25, 2021
Hey @torynet a couple of remarks:
First, we seemingly have different issues. In my case I don't get any oauth errors, the orgs simply don't receive a response from the localhost server listening on 1717. That being said, downgrading the
salesforcedxplugin to50.1.0(sfdx plugins:install [email protected]) took care of my issue, without downgrading thesfdx-cliat all, maybe something worth trying?Also I saw now you are using node 12, could you try upgrading to 14?
Best
kresho commentedon Feb 25, 2021
Same issue for me.
Ubuntu 20.10 Linux 5.10.2-surface, sfdx 7.82.1-0
The browser redirect to localhost never completes. With trace debugging the last message i get in the log is:
socket connection initialized from 127.0.0.1repeated a few times but never does anything.
Downgrading to 7.26 worked.
dhbahr commentedon Feb 25, 2021
Not to tell you what to do or anything, but I feel downgrading the salesforcedx plugin is a better approach, leaves you less outdated, @kresho .
torynet commentedon Feb 25, 2021
@dhbahr We got the same "localhost never responds / white screen forever" sort of response initially, prior to downgrading, but while it's doing that if you refresh the page, you will then get an oauth error.
Since downgrading it seems to skip that phase and go right to the oauth error.
I'll reinstall up to current again and see if I can get it to downgrade the plugin. Hopefully that will do something now.
I suppose I can upgrade node... I didn't pay attention to that. I told just told NPM to update. I'll try that as well though.
Thanks for the advice.
dhbahr commentedon Feb 25, 2021
@torynet yeah, as I mentioned a couple of comments ago, it strikes me we are experiencing 2 different bugs (albeit having the same negative impact). Hope reinstalling works for you.
[-]sfdx force:auth:web:login not working (also via VSCode extensions) but sfdx auth:web:login is working[/-][+]sfdx force:auth:web:login not working (also via VSCode extensions), sfdx auth:web:login is also not working[/+]alanmangalindan commentedon Feb 28, 2021
this worked for me:
downgrade sfdx-cli: npm install [email protected] --global
downgrade salesforcedx plugin: sfdx plugins:install [email protected]
downgrade auth plugin: sfdx plugins:install [email protected]
torynet commentedon Mar 1, 2021
@alanmangalindan I was really hopeful that your very precise procedure would work for me. Thanks for posting it.
Unfortunately, it did not. No change.
sfdx -v
» Warning: sfdx-cli update available from 7.86.3 to 7.88.4.
sfdx-cli/7.86.3 win32-x64 node-v14.16.0
sfdx plugins --core
» Warning: sfdx-cli update available from 7.86.3 to 7.88.4.
@oclif/plugin-autocomplete 0.1.5 (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.3.10 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/analytics 0.23.0
@salesforce/sfdx-trust 3.6.0 (core)
alias 1.1.5 (core)
analytics 1.12.1 (core)
auth 1.4.7 (1.4.7)
config 1.2.4 (core)
generator 1.1.5 (core)
mo-dx-plugin 0.3.2
salesforcedx 50.13.1 (50.13.1)
├─ user 1.0.4
├─ schema 1.0.3
├─ limits 1.0.2
├─ salesforce-alm 50.13.1
├─ @salesforce/sfdx-plugin-lwc-test 0.1.7
├─ templates 50.4.0
├─ custom-metadata 1.0.11
└─ apex 0.1.4
sfdx-cli 7.86.3 (core)
telemetry 1.0.1 (core)
texei-sfdx-plugin 1.9.3
@dhbahr No, I'm fairly certain we are experiencing the same bug. I'm just seeing some slightly different behavior at various times, based on changes I have made to try and troubleshoot. If I take everything back to the latest and "greatest", revoke my oauth connected app user, and try again, I see the same problems as I originally did, which are exactly as you describe.
We do seem to have some differences though, because the things that are working for you all, are not for me.
dhbahr commentedon Mar 1, 2021
I see, a pain in the a**e no doubt.
dhbahr commentedon Mar 1, 2021
I can also confirm the newest 7.89.2 release still presents the same issue for me.
alanmangalindan commentedon Mar 2, 2021
This is really a bit unfortunate as authorising an org should be the easy part in using dx.
Maybe a couple of other options would be to try out other previous stable versions like 7.82.1, or to use the sfdx auth:jwt:grant command, which I haven’t encountered a problem with. But that means going through the pain of setting up a connected app and generating a certificate, like what a cicd set up will use.
alanmangalindan commentedon Mar 10, 2021
Seems to be working already with the latest sfdx cli release 51.2.2 (March 4, 2021) - CLI 7.90.2