Skip to content

MrBurgerCZ/ThinkPad-fingerprint-auth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 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

You can look at this "issue", it should help you. Thanks bc09880! :)

Here is the most important part:

1. Clear the Fingerprint Database

The first thing I tried was deleting all registered fingerprints, as this is a common step for resolving issues with corrupted records. This is necessary after successfully enabling the python3-validity service:

fprintd-delete $USER

Expected result: Fingerprints deleted on DBus driver

2. Verify that No Fingerprints Were Registered

After clearing the database, I checked that no fingerprints remained registered by running:

fprintd-verify

Expected result: No fingers enrolled for this device.

3. Try Registering the Fingerprints Again

After clearing the database and confirming it was empty, I resumed the fingerprint registration process. I first registered the left index finger (which worked without issues), then I tried registering the right index finger.

Register Left Index Finger:

fprintd-enroll -f left-index-finger

Expected result: enroll-completed (successful registration)

Register Right Index Finger (after clearing the database):

fprintd-enroll -f right-index-finger

Expected result: enroll-completed (successful registration after clearing the database)

Lessons Learned

What DIDN'T Work:

* **Simply running `fprintd-enroll`** did not resolve the issue. The fingerprint registration wouldn’t complete, and the error kept occurring.

* Trying to register **right-index-finger** multiple times without clearing the database.

* Using the incorrect command `sudo fprintd-delete right-index-finger` (instead of clearing the entire database with `$USER`).

* Restarting the services alone without clearing the database.

What DID Work:

* **Completely clearing** the database with `fprintd-delete $USER`.

* **Starting fresh** with all records deleted.

* First registering the finger that worked (left index), and then the problematic one (right index).

Troubleshooting 2

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

 
 
 

Contributors