fairyglade / ly

display manager with console UI
Do What The F*ck You Want To Public License
4.74k stars 290 forks source link

Support for fingerprint login? #227

Open sunng87 opened 3 years ago

sunng87 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 2 years ago

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

Oman395 commented 1 year ago

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 commented 1 year ago

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 commented 6 months ago

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 commented 3 months ago

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 commented 2 months ago

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 commented 1 month ago

+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 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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

kercre123 commented 1 month ago

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 commented 1 month ago

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 commented 1 week ago

@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.