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

Pam authentication #273

Merged
merged 12 commits into from
Jan 31, 2024
Merged

Pam authentication #273

merged 12 commits into from
Jan 31, 2024

Conversation

kotontrion
Copy link
Contributor

@kotontrion kotontrion commented Jan 25, 2024

Adds methods to Utils to be able to authenticate against Pam.

Utils.authenticate("password")
  .then(res => {
    //auth was successful
  })
  .catch(logError)
Utils.authenticate_user("username", "password")
  .then(res => {
    //auth was successful
  })
  .catch(logError)

Note:
This is the first time I wrote a gir lib and it's been a long time since I used C, so it might be a good idea to check this a bit more in detail.

@kotontrion
Copy link
Contributor Author

I just thought, this should probably made async. Depending on the pam configuration, there may be a delay when authentication fails. This will currently freeze ags for that time (I didn't test this though).

@Aylur
Copy link
Owner

Aylur commented Jan 27, 2024

It definitely needs to be async yes

@kotontrion
Copy link
Contributor Author

I noticed an issue with this, which is quite easy fixable, I'm just writing this here to remember it.

This will create a libpam.so library in the libdir. The default libdir currently is /usr/lib, so this will overwrite the libpam.so file of the Pam package, and therefore breaking pam.
This is fixable by either renaming our Pam module to something like libagspam.so or something similar, or even better use /usr/lib/ags as the default libdir. This is already done by the AUR package, and the reason I didn't notice this issue until now.

@Aylur
Copy link
Owner

Aylur commented Jan 29, 2024

I think its fine, Gvc is also installed there, and we didn't get any feedback about it being an issue
But if we decide to rename it, I would like to avoid having ags in its name, because the eventual rebranding for the gtk4 version. libpamauth or maybe something like libgutils because I would also like to support input inhibiting sometime which needs to be in c too

@kotontrion
Copy link
Contributor Author

Well actually, there was a complaint on discord a few month ago, because gvc installs to /usr/lib/libgvc.so which conflicts with the graphviz package. That's the reason why the aur package has the --libdir parameter set to /usr/lib/ags.

This is only an issue if installed from source following the instructions on the wiki, as there the libdir is set to /usr/lib. So if someone does not know about this and follows the wiki for manual installation ends up with a broken pam install (as Pam is installed on almost every system). This should be avoided. Maybe at least add the --libdir parameter to meson in the wiki then.

I would also like to support input inhibiting

If you are talking about the input inhibitor Wayland protocol, that's been deprecated for a while now. For lockscreens the ext-session-lock protocol should be used.

@Aylur Aylur merged commit 8bb757d into Aylur:main Jan 31, 2024
@kotontrion kotontrion deleted the feat/pam branch February 19, 2024 07:40
gorsbart pushed a commit to gorsbart/ags that referenced this pull request Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants