Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for fingerprint login? #227

Open
sunng87 opened this issue Aug 15, 2020 · 17 comments · May be fixed by #654
Open

Support for fingerprint login? #227

sunng87 opened this issue Aug 15, 2020 · 17 comments · May be fixed by #654
Labels
bug This issue or pull request discusses a bug ok This issue or pull request was confirmed/reviewed

Comments

@sunng87
Copy link

sunng87 commented Aug 15, 2020

I followed this guide to add fingerprint setup to /etc/pam.d/ly but unfortunately it didn't work.

It would be nice to add support for fingerprint login and fprint has been a great tool to do that.

@JAicewizard
Copy link

ly works with fprint, but you have to enter a wrong password first.
I think this would be solved by always having one PAM session running with empty password.

@sdylix
Copy link

sdylix commented Dec 22, 2020

try this so your fingerprint works first then it will ask for password
cat /etc/pam.d/ly

#%PAM-1.0
auth sufficient pam_unix.so try_first_pass likeauth nullok
auth sufficient pam_fprintd.so
auth include system-local-login
account include system-auth
password include system-auth
session include system-auth

@nullgemm nullgemm added bug This issue or pull request discusses a bug ok This issue or pull request was confirmed/reviewed labels Apr 26, 2022
@nullgemm
Copy link
Collaborator

I don't have the required hardware to test this, but it is an issue and should be fixed

@Oman395
Copy link

Oman395 commented Mar 20, 2023

Currently using

#%PAM-1.0
auth            sufficient      pam_fprintd.so
auth            sufficient      pam_succeed_if.so user ingroup nopasswdlogin
auth            include         system-login
-auth           optional        pam_gnome_keyring.so
-auth           optional        pam_kwallet5.so
account         include         system-login
password        include         system-login
session         include         system-login
-session        optional        pam_gnome_keyring.so auto_start
-session        optional        pam_kwallet5.so auto_start force_run

as my /etc/pam.d/ly, works pretty good but I need to hit enter before it accepts the fingerprint-- any idea how to remove that?

@Oman395
Copy link

Oman395 commented Mar 20, 2023

Update: cloned the repo, added

  // !! BAD IDEA !! This is just for fprint stuff lol

  // I think this draws the UI
  if (auth_fails < 10) {
    (*input_handles[active_input])(input_structs[active_input], NULL);
    tb_clear();
    animate(&buf);
    draw_box(&buf);
    draw_labels(&buf);
    if (!config.hide_f1_commands)
      draw_f_commands();
    draw_lock_state(&buf);
    position_input(&buf, &desktop, &login, &password);
    draw_desktop(&desktop);
    draw_input(&login);
    draw_input_mask(&password);
    update = config.animate;
  } else {
    usleep(10000);
    update = cascade(&buf, &auth_fails);
  }

  tb_present();

  // This is what happens when you press enter, which seemed to allow fprint to work
  save(&desktop, &login);
  auth(&desktop, &login, &password, &buf);
  update = true;

to line 169, which worked-- but for some reason the box is offset to the top left until a key is pressed. Oh well, good enough looking :P

@gBonvenuto
Copy link

gBonvenuto commented Dec 24, 2023

Hi guys, any updates on it?
I just started using ly this week and today tried to enable fingerprint login, currently I'm using Debian, and I also need to hit Enter first (which freezes the screen) to be able to login with my fingerprint

This is my /etc/pam.d/ly:

#%PAM-1.0

auth 	   sufficient   pam_unix.so try_first_pass likeauth nullok
auth	   sufficient   pam_fprintd.so
auth       include      login
account    include      login
password   include      login
session    include      login

Also, if this information is of any use, I used this tutorial to enable fprintd.

Edit: the same happens with i3lock for me, so it might not be an issue specific to ly, but I'm not sure.

@maipley
Copy link

maipley commented Mar 7, 2024

Hi, for anyone still with this problem, I have this:

auth sufficient pam_unix.so try_first_pass likeauth nullok
auth sufficient pam_fprintd.so
auth include login
account include login
password include login
session include login

You have to hit enter to skip to the fingerprint authentication, and it should work the other way if you switch the first two statements.
I got it working even with the open-fprintd + python-validity setup.
Hope it helps!

@Narmis-E
Copy link

Narmis-E commented Apr 6, 2024

I have a goodix 550a fingerprint reader, and with the same pam file as mentioned by @maipley, the fingerprint is detected, but ly returns authentication faliure after scanning. I have installed the libfprint-2-tod1-goodix package from the AUR, but not sure where the issue lies. The enrollment and verification works perfectly, but ly doesn't like it.

I also get a kind of faillock occurrence with all users after attempting the fingerprint, and have to resort to a different tty to login with any user. Just thought I'd put this out there. Thanks.

@kercre123
Copy link

+1. It'd probably have to have a PAM session running in a thread. An auth success from that thread could then be an event caught in the main loop (or just an "if_pam_success" variable). I might try this and make a PR.

@kercre123
Copy link

I updated my fork to include fingerprint login (via libfprintd) by default. I also made a new colorful matrix animation. It uses an old pre-Zig commit as I made the animation before the rewrite. It's a little janky but seems to work fine. https://github.com/kercre123/ly

@Narmis-E
Copy link

Narmis-E commented May 23, 2024

Thanks! When I go back to ly (killing sway) it works! Not sure why it doesn't work from boot, (I am met with a blinking cursor of death). Likely just my setup.

Update: it's similar to what has been mentioned before, you need an invalid input and then the sensor will work. :)

@JAicewizard
Copy link

I can try to port the changes to zig, but its gonna take a while since I don't have much time ATM

@kercre123
Copy link

Looks like it might be easier to add this to the current commit since startSession is already its own function. I have no experience with Zig but I think I could try

@JAicewizard
Copy link

I pushed my commits here: https://github.com/JAicewizard/ly/tree/fingerprint, and added you as co-author. Are you ok with me creating a PR for this? If you want to have your own go thats fine too, I mainly wanted to try zig again.

@AnErrupTion
Copy link
Collaborator

@JAicewizard Hey there! It'd be nice if you could create a PR for this. I'm not sure how @kercre123 feels about this though.

@JAicewizard JAicewizard linked a pull request Jul 17, 2024 that will close this issue
@JAicewizard
Copy link

I opened up a PR, but I noticed one issue. After logging in with fingerprint, and then logging back out again, sway doesn't start. I will not have time to debug this anytime soon, so any help would be appreciated! @kercre123 Do you have more experience with login managers?

@JAicewizard
Copy link

Nevermind! I think I fixed it, along with a major rewrite of the PR, sorry for the spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue or pull request discusses a bug ok This issue or pull request was confirmed/reviewed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants