Modifying the login screen with extra fields/prompts?


Not sure if this is the right place to ask but here goes…

I’ve been experimenting with enabling login to an openSUSE machine using a Yubikey as a second factor of authentication (just to see if I could do it, not for anything critical). I won’t go into too much detail about what a Yubikey is (slightly outside the scope of what I’m about to ask) but you can go to if you want to find out more about what they are. I’m currently running 64-bit openSUSE Tumbleweed with KDE on an older laptop.

I’ve successfully managed to alter the procedure for gaining su privileges in a text console to prompt for Universal 2nd Factor (U2F) authentication with a newer Yubikey, by way of modifying the /etc/pam.d/su file (again I won’t go into too much detail about U2F but you can search online if you’re curious). For reference please see below links (listed in chronological order) to screenshots with notes of what my terminal window shows when authenticating myself via U2F (sorry, my Google Drive links don’t seem to let me display the images directly here):

(Let me know if you have problems with the above links and I’ll try to upload them somewhere else)

I’m wondering if the above can be replicated in a graphical login window. When I try to add the config to the /etc/pam.d/sddm file to enable the U2F authentication module, then logout and try logging in again; it freezes briefly but then says “login failed” before I even get a chance to plug my Yubikey in. If however I have it plugged in beforehand and touch the Yubikey’s button quickly enough after entering my password I can get in. Is there a way the graphical login screen can be modified to give the same or similar prompts as I get in the above screenshots so that it doesn’t freeze up and kick me out?

Any help would be appreciated. Thanks.