mirror of
https://github.com/open-webui/open-webui.git
synced 2026-06-07 09:19:06 -05:00
[GH-ISSUE #17682] issue: Open WebUI rejects LDAP users with missing mail attribute #18366
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @LarryStewart2022 on GitHub (Sep 23, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/17682
Check Existing Issues
Installation Method
Git Clone
Open WebUI Version
v0.6.30 (latest)
Ollama Version (if applicable)
0.11.3
Operating System
Ubuntu 22.04.5 LTS
Browser (if applicable)
Chrome
Confirmation
README.md.Expected Behavior
Open WebUI should allow LDAP users to authenticate successfully even if the
mailattribute is empty in Active Directory.If "Attribute for Mail" is set to
userPrincipalName, that value should be used as the email instead of requiringmail.Actual Behavior
LDAP authentication fails with "LDAP authentication failed" when the AD user has no
mailattribute set.From testing with
ldapsearch, the bind and filter work correctly and return the user entry, but Open WebUI still rejects the login.Our AD user has
sAMAccountNameanduserPrincipalNamepopulated, butmailis blank.Steps to Reproduce
ldapsearchfrom the Open WebUI host:ldapsearch -x -H ldap://:389 -D "" -W -b "DC=example,DC=com" "(&(objectClass=user)(userPrincipalName=testuser@domain.com))"
→ This succeeds and returns the user entry.
Logs & Screenshots
Browser UI shows: "LDAP authentication failed"
No additional error message in the UI.
Ubuntu server test with ldapsearch succeeds:
ldapsearch -x -H ldap://-dc..com:389
-D "CN=webui_bind,OU=Users,DC=,DC=com" -W
-b "DC=,DC=com"
"(&(objectClass=user)(|(sAMAccountName=lstewart)(userPrincipalName=lstewart@.com)))"
sAMAccountName userPrincipalName mail
Result:
dn: CN=Larry Stewart,OU=Users,DC=,DC=com
sAMAccountName: lstewart
userPrincipalName: lstewart@***.com
mail: (empty)
search result
result: 0 Success
I replaced my actual domain name with *** for this bug report only.
Additional Information
sAMAccountNameanduserPrincipalNamepopulated, but many accounts do not have themailattribute filled.mail, login fails (since mail is empty). If we set it touserPrincipalName, login still fails.mailis empty, Open WebUI fails internally when creating the user record.userPrincipalNameto be used for "mail" or to gracefully handle missing mail attributes.@tjbck commented on GitHub (Sep 23, 2025):
PR welcome!