Skip to content

fix(ldap): case-insensitive attribute lookup, request login attribute in search - #338

Merged
lixmal merged 1 commit into
masterfrom
ldap-attr-ci
Aug 25, 2026
Merged

fix(ldap): case-insensitive attribute lookup, request login attribute in search#338
lixmal merged 1 commit into
masterfrom
ldap-attr-ci

Conversation

@lixmal

@lixmal lixmal commented Aug 25, 2026

Copy link
Copy Markdown
Owner

Same change as #296, rebased onto master after #271 landed. The only conflict was that both added a tests module to ldap.rs; the two sets of tests are now side by side. Authorship of the commit is unchanged.

  • Look attributes up case-insensitively, since attribute names are case-insensitive per RFC 4512 while servers answer in their own casing (OpenLDAP returns cn for CN)
  • Ask for the configured login attribute in the search, which was missing from the requested attribute list

… in search

LDAP attribute names are case-insensitive (RFC 4512), but servers return
them in their own canonical casing: openldap returns 'cn' for a requested
'CN', so the case-sensitive HashMap lookup failed with 'CN attribute not
found' after successful credential verification.

The search also only requested the CN attribute, so the login attribute
(e.g. uid) was never returned and its lookup failed next.

Verified end-to-end against openldap 2.6: valid credentials log in,
wrong/empty passwords are rejected.
@lixmal
lixmal merged commit 1a00fbe into master Aug 25, 2026
7 checks passed
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