bitwarden / clients

Bitwarden client apps (web, browser extension, desktop, and cli).
https://bitwarden.com
Other
9.32k stars 1.26k forks source link

Chrome does not redirect to desktop app while SSO login #2606

Open Greenderella opened 3 years ago

Greenderella commented 3 years ago

Describe the Bug

When you only have Bitwarden's AppImage in your Linux machine, if you click Enterprise Single Sign On your browser opens.

After you authenticate yourself with SSO, if you are using Firefox (Version 88.0.1 in this case) you can "Choose an application to open the bitwarden link." and select the AppImage file, and you get correctly redirected to the desktop app (see images firefox 1 and firefox 2).

But, if you are using Chrome (Version 90.0.4430.93 in this case), after you authenticate yourself with SSO you can only select the option "Open xdg-open?" and then you get nothing but a blank page stuck at https://bitwarden.yourURL.com/identity/Account/ExternalCallback (see image chrome)

Steps To Reproduce

  1. Open Bitwarden's AppImage desktop app
  2. Click on Enterprise Single Sign On
  3. Chrome should open
  4. Authenticate yourself with SSO
  5. Click on "Open xdg-open?"
  6. Blank page stuck at https://identity.bitwarden.com/identity/Account/ExternalCallback

SSO jumpcloud

Expected Result

The browser should redirect back to the desktop app in order to conclude the login process by introducing email + master password.

Actual Result

A blank page stuck at https://identity.bitwarden.com/identity/Account/ExternalCallback

Screenshots or Videos

firefox 1 firefox 2 chrome

Environment

Additional Context

This issue could be related.

The issue is not present with the snap installation.

chrisipa commented 3 years ago

Same behaviour for the Cloud version of Bitwarden:

Environment Operating system: Ubuntu 20.04.2 LTS Browser: Chrome Version 90.0.4430.93 Installation method: Snap Build Version: 1.26.5 Self-hosted? No

In my case the callback tries to open another instance of the Bitwarden desktop client. This way the SSO authentication is not successfull and the authentication flow just starts from the beginning.

chrisipa commented 3 years ago

I have now solved the problem with this workaround:

1.) Set Firefox as default browser in Ubuntu 2.) Download AppImage version of Bitwarden 3.) Open the AppImage file when chrome tries to open the URL for the authentication callback

So I had no luck at all with the installation of the Snap package.

giamat6 commented 3 years ago

Same issue for me with Arch Linux (Garuda) and Gnome-shell (but also with Cinnamon).. Both on Xorg and Wayland the app seems not receives the SSO response like "bitwarden://...." I tried to pass it also as args to bitwarden-desktop binary without results, the app opens but doesn't login.. It seems that not parse the args.

I tried with Firefox, Brave (also beta version), Vivaldi and Chrome, xdg-open seems not configured for open the app for "bitwarden" x-scheme-handler, I added it by hands, on local .config/mimeapps.list and in this way, browsers can open bitwarden-desktop app; but the app doesn't continue the authentication after opened

bitwarden-bot commented 2 years ago

Hi @Greenderella, We're cleaning up our repositories in preparation for a major reorganization. Issues from last year will be marked as stale and closed after two weeks. If you still need help, comment to let us know and we'll look into it. Thanks!

chrisipa commented 2 years ago

We still need this issue !!!

dabstractor commented 2 years ago

I arrived here after having this same issue with the figma-linux and postman snap packages. It seems to affect all snaps that require redirection to the browser in order to log in.

neffets commented 2 years ago

same here. Ubuntu 22.04, chrome is default browser, AppImage in version bin/AppImage/Bitwarden-2022.9.1-x86_64.AppImage

neffets commented 2 years ago

Solution:

Create a .desktop file in ~/.local/share/applications ~/.local/share/applications/bitwarden.desktop

[Desktop Entry]
Name=Bitwarden
GenericName=Passwortmanager
Exec=$HOME/bin/AppImage/Bitwarden-2022.9.1-x86_64.AppImage --no-sandbox %U
TryExec=$HOME/bin/AppImage/Bitwarden-2022.9.1-x86_64.AppImage
Icon=$HOME/.local/share/icons/hicolor/256x256/apps/bitwarden.png
StartupWMClass=Bitwarden
StartupNotify=true
Terminal=false
Type=Application
Version=1.0
Categories=Utility;Security;Qt;
MimeType=application/x-bitwarden;x-scheme-handler/bitwarden;
X-GNOME-Autostart-enabled=true
X-GNOME-Autostart-Delay=2
X-KDE-autostart-after=panel
X-LXQt-Need-Tray=true

Then run

update-desktop-database ~/.local/share/applications

1) the '%U' in the Exec line solves the problem, that bitwarden opens again and really becomes the sso-url as parameter 2) the update-desktop-database, re-registers the x-scheme protocol handlers

laurentvasseurtekos commented 2 years ago

Hello everyone , I faced kind of the same issue with the snap packages on ubuntu 22.04. I fixed the issue by updating my file /var/lib/snapd/desktop/applications/bitwarden_bitwarden.desktop like this :

[Desktop Entry]
X-SnapInstanceName=bitwarden
Name=Bitwarden
Exec=env BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/bitwarden_bitwarden.desktop /snap/bitwarden/current/bitwarden %U
Terminal=false
Type=Application
Icon=/snap/bitwarden/current/meta/gui/icon.png
StartupWMClass=Bitwarden
GenericName=Password Manager
Comment=A secure and free password manager for all of your devices.
Categories=Utility;

I hope it will help you :)

TheBestPessimist commented 2 years ago

This issue happens on windows as well

wrosenauer commented 1 year ago

I used the workaround in https://github.com/bitwarden/clients/issues/2606#issuecomment-1268993899 before successfully a few months ago but I cannot get it to work anymore. Did anything change in the appimage? Or any hints? The only feedback from calling the appimage with the callback uri seems to be: (node:8457) DeprecationWarning: file property is deprecated and will be removed in v5.

guillemglez commented 1 year ago

Having the same issue for the snap package of Bitwarden

Version 2023.10.1 Shell 25.9.1 Renderer 114.0.5735.289 Node 18.15.0 Architecture x64

ghost commented 1 year ago

Hi there,

This issue is still happening on Ubuntu with both the AppImage and Snap package.

This is a problem for our org because we use SSO + Trusted Devices and I want my users to be able to register their desktop app to approve login requests.

Bitwarden 2023.10.1 Chrome browser Ubuntu 22.04

ll-michael commented 9 months ago

I am also having the same issue.

Running xdg-open https://identity.bitwarden.com/account/ExternalCallback does not work either.

Ubuntu 22.04.3:LTS

EDIT: Fixed as of 2024

ghost commented 8 months ago

We're coming up on 3 years with this issue open. Has a fix been roadmapped yet?

Felixoid commented 5 months ago

The arch linux package has a scheme handler in its desktop file, and it still doesn't work

I need to open the developer console and copy the location header to handle it properly. Opening it as bitwarden-desktop 'bitwarden://.....' plays the trick.

Here's a full manual: