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

Why does "attribute uid cannot be an expression"? #45

Open
azmeuk opened this issue Jan 29, 2021 · 1 comment
Open

Why does "attribute uid cannot be an expression"? #45

azmeuk opened this issue Jan 29, 2021 · 1 comment
Labels

Comments

@azmeuk
Copy link

azmeuk commented Jan 29, 2021

My main usage for nss-pam-ldapd is with my mail server. OpenSMTPD uses PAM to authenticate users, where I plugged nss-pam-ldapd.

Sometimes users authenticate with their correct uid, but sometimes they also use their email address uid@mydomain.tld to authenticate.

I would love nslcd to be able to remove the @mydomain.tld part when present. This way users could authenticate both ways. In nslcd.conf I tried this:

map uid "${uid:%@mydomain.tld}"

But I get this error message when restarting the service: attribute uid cannot be an expression

I suggest removing this limitation so my usecase is usable.

What do you think?

@arthurdejong
Copy link
Owner

The main reason you can't do arbitrary conversion on some attributes is that they are also used to build search queries. The uid attribute is used to build the following search query:

(&(objectClass=posixAccount)(uid=someusername))

Note however that there is a pull request in progress for doing user name transformations in the PAM stack. That means the user name is changed on login.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants