Skip to content

Use the fingerprint reader on your ThinkPad to authenticate

Notifications You must be signed in to change notification settings

MrBurgerCZ/ThinkPad-fingerprint-auth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 

Repository files navigation

Important

This has been tested on 2016 ThinkPad X270.
Made for the ID 138a:0097 Validity Sensors, Inc. scanner.

Demo

Demo

https://www.youtube.com/watch?v=oYyE5cBVhgk

Successful read:

Screenshot from 2024-10-11 20-17-05

Failed read (and successful in the end):

Screenshot from 2024-10-11 20-17-17

Setup on Arch

Firstly, check if you have the right fingerprint sensor by running lsusb:

~ lsusb
Bus 001 Device 007: ID 138a:0097 Validity Sensors, Inc.

(It might work with a different scanner, you can try it.)

yay -S python-validity

Note

You might need to install libfprint-vfs009x-git in addition if it doesn't work alone, I am not sure yet

Scan your finger:

fprintd-enroll

Verify it with:

fprintd-verify

Unlocking after suspend

Normally, the reader stops working after suspending your laptop, so here is a fix:

Create a service file:

sudo nano /etc/systemd/system/restart_fprintd_after_sleep.service

Paste this code into the file:

[Unit]
Description=Restart services to fix fingerprint integration
After=suspend.target hibernate.target hybrid-sleep.target suspend-then-hibernate.target

[Service]
Type=oneshot
ExecStart=systemctl restart open-fprintd.service python3-validity.service

[Install]
WantedBy=suspend.target hibernate.target hybrid-sleep.target suspend-then-hibernate.target

And activate it:

sudo systemctl enable --now restart_fprintd_after_sleep.service

PAM:

Now, to activate the reader after running sudo, add this on top of /etc/pam.d/system-auth:

auth            sufficient      pam_unix.so try_first_pass likeauth nullok
auth            sufficient      pam_fprintd.so

You can enable fingerprint login in swaylock, by adding the same code into /etc/pam.d/swaylock.
Or on your login screen (ly, etc.) (/etc/pam.d/system-login), SDDM (/etc/pam.d/sddm), ...

Troubleshooting

From python-validity

If fprintd-enroll returns with

list_devices failed:

or

GDBus.Error:net.reactivated.Fprint.error.NoSuchDevice

you can check the logs of the python3-validity daemon using

sudo systemctl status python3-validity

If it's not running, you can enable and/or start it by substituting status with enable or start.

If systemctl status python3-validity complains about errors on startup, you may need to factory-reset the fingerprint chip. Do that like so:

sudo systemctl stop python3-validity
sudo validity-sensors-firmware
sudo python3 /usr/share/python-validity/playground/factory-reset.py
sudo systemctl start python3-validity
fprintd-enroll

At some of the above points you may get a Device busy error, depending on how systemctl plays along. Kill offending processes if necessary, or re-run systemctl stop python3-validity, in case it has automatically been restarted.

About

Use the fingerprint reader on your ThinkPad to authenticate

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published