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

Separate LDAP lookup fields from User lookup fields #273

Open
jholladay10 opened this issue May 3, 2024 · 4 comments
Open

Separate LDAP lookup fields from User lookup fields #273

jholladay10 opened this issue May 3, 2024 · 4 comments

Comments

@jholladay10
Copy link

It seems that the LDAP lookup names are the same as the User lookup names (both taken from LDAP_AUTH_USER_LOOKUP_FIELDS. I'd like them to be allowed to be separate.

My scenario occurs with Active Directory. I don't know whether it can occur with OpenLDAP.

As an example, I would like to use sAMAccount name to authenticate as AD, but use the object GUID to look up the user. That way, if a user's sAMAccountName changes, their permissions will remain associated with their object guid instead of losing their permissions or, worse, assuming someone else's permissions who previously had that sAMAccount name. I think the same could apply to upn. This does introduce the edge case of an "old" username conflicting with a "new" username in the database.

To address this, i would:

  1. Create a setting LDAP_AUTH_USER_BIND_FIELDS
  2. Use this value or, if empty, use LDAP_AUTH_USER_LOOKUP_FIELDS, when binding to LDAP
  3. When getting the user, if the user lookup fields are different than the bind fields, look up the user on each set and compare them.
  4. If the user object is the same or the username lookup failed to retrieve an object, then there is no conflict and the current behavior is fine.
  5. If there is a conflict, then the current object guid can retain the current LDAP lookup fields, and the LDAP lookup fields for the other user object need to be updated to eliminate the conflict. A default AD implementation would be to look up the conflicting user on their object guid and update their user record to reflect the current sAMAccountName for that object.
@etianen
Copy link
Owner

etianen commented May 9, 2024 via email

@jholladay10
Copy link
Author

jholladay10 commented May 10, 2024 via email

@etianen
Copy link
Owner

etianen commented May 10, 2024 via email

@jholladay10
Copy link
Author

jholladay10 commented May 10, 2024 via email

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

No branches or pull requests

2 participants