Installing 1Password in Bluefin, a better way?

How is Bitwarden working out for you?

In case you or anyone else has this same problem, I spent hours today trying to get Bitwarden’s Firefox extension to unlock with biometrics when running Firefox under Flatpak and finally got a working solution.

Here’s a concise fix as a shell session:

$ mkdir $HOME/.var/app/org.mozilla.firefox/.mozilla/native-messaging-hosts
$ cd $HOME/.var/app/org.mozilla.firefox/.mozilla/native-messaging-hosts
$ cat <<EOF > com.8bit.bitwarden.json
{
  "name": "com.8bit.bitwarden",
  "description": "Bitwarden desktop <-> browser bridge",
  "path": "$HOME/.var/app/org.mozilla.firefox/.mozilla/native-messaging-hosts/bitwarden-proxy.sh",
  "type": "stdio",
  "allowed_extensions": ["{446900e4-71c2-419f-a6a7-df9c091e268b}"]
}
EOF
$ cat <<EOF > bitwarden-proxy.sh
#!/bin/bash
flatpak-spawn --host /usr/lib/opt/Bitwarden/desktop_proxy "$@"
EOF
$ chmod +x bitwarden-proxy.sh
$ sudo flatpak override --talk-name=org.freedesktop.Flatpak org.mozilla.firefox

(That last command could be done without sudo through Flatseal if preferred. Also, feel free to change /usr/lib/opt/Bitwarden to /opt/Bitwarden, which should be a symlink made by Blue Build’s “optfix” step.)

In short, this configures Flatpak Firefox to be able to run Bitwarden’s desktop_proxy command via native messaging, which it is otherwise unable to do. Native messaging is how the extension talks to the desktop app to unlock via biometrics, as seen here.

I noticed that if I download and run Firefox outside of Flatpak, the Bitwarden extension seems to manage this by itself by creating $HOME/.mozilla/native-messaging-hosts/com.8bit.bitwarden.json which runs /usr/lib/opt/Bitwarden/desktop_proxy directly.

I don’t know Flatpak well enough, but there may be a simpler way to do this by allowing Flatpak Firefox to write to $HOME/.var/app/org.mozilla.firefox/.mozilla/native-messaging-hosts (so it can setup the com.8bit.bitwarden.json file) and to run /usr/lib/opt/Bitwarden/desktop_proxy directly as well.

Hope this helps.