Firefox (and Thunderbird, Vivaldi...) regularly prompt "Please enter the password for the PKCS#11 token (name)" with a Yubikey or similar attached

Problem

If you leave a Yubikey or similar PKCS#11-compliant physical authentication device connected to the system and have Firefox and/or Thunderbird running, it may continually show a request to “Please enter the password for the PKCS#11 token (name)”.

You can discuss this issue here.

Cause

This is ultimately caused by a bug in OpenSC, which has two fixes pending.

Related Issues

Bugzilla report: #1892137

Workarounds (no longer needed, for reference only)

The easiest workaround may be just to unplug the authentication token when you are not using it.

If you can’t do that, and you don’t use the smartcard feature of your authentication device, you can remove the opensc package to avoid this issue. If you use the smartcard feature but not in affected applications, you can do something like this (as regular user, not root) to disable it in specific affected applications (thanks to Robert Bohne):

mkdir -p ~/.config/pkcs11/modules
cp /usr/share/p11-kit/modules/opensc.module ~/.config/pkcs11/modules/
echo "disable-in: firefox thunderbird vivaldi-bin" >> ~/.config/pkcs11/modules/opensc.module

the values in the last line are executables to disable the feature for; that list covers Firefox, Thunderbird and Vivaldi. You can adjust it for your situation. Then restart the affected applications. If this doesn’t work, you can instead edit the file /usr/share/p11-kit/modules/opensc.module directly, though your edits will be lost each time the opensc package is updated and you will need to re-do them.

Solution

An update has been released to fix this issue in Fedora Linux 38.

After you update your system in your usual way (and possibly reboot), you should no longer be affected by this problem. If the problem persists, please start a new discussion topic and we’ll help figure out what’s still wrong.

An update has been released to fix this issue in Fedora Linux 38.

After you update your system in your usual way (and possibly reboot), you should no longer be affected by this problem. If the problem persists, please start a new discussion topic and we’ll help figure out what’s still wrong.

See the linked system updates which should resolve the problem. Just update your system as usual to receive those updates. If you’ve used a workaround to disable smartcard support in a specific application, don’t forget to revert the change (see Workarounds).