Smartcard access for native Firefox

Unfortunate. But it is very much possible to use flatpak browsers with a smart card.

The main issue is that the pcsc portal doesn’t quite work correctly. So the solution is to expose your host’s p11-kit to the guest.

You can do this with flatpak overrides.

In your terminal do the following:

systemctl enable --now --user p11-kit-server.socket
systemctl enable --now --user p11-kit-server.service

flatpak override --filesystem=xdg-run/p11-kit/pkcs11 org.mozilla.firefox

Restart Firefox. You will now be able to add the p11-proxy device to your Firefox security devices and use your smart card.

Gotchas I’ve seen with this is that it needs to be an actually supported reader by opensc. Additionally this exposes your tokens to your browser. This is more than what flatpak initially allows. But this does get it working.