User asked to input email during first ldap login #1249

Closed
opened 2026-02-05 00:24:19 +03:00 by OVERLORD · 2 comments
Owner

Originally created by @ElvisTheKing on GitHub (Jul 3, 2019).

Describe the bug
User asked to input email during the first login even if there is email in AD record and LDAP_EMAIL_ATTRIBUTE is set correctly.

We are using AD and email is stored in userPrincipalName field.
One thing that can cause the problem is that our email domain is orgname.global , not all email parsers work with this kind of tld. Unfortunately I have no control over AD and can't test with another tld.

Email Confirmation in settings is set to false. No domain restrictions set.

ldap related part of .env:

LDAP_BASE_DN=dc=orgname,dc=global
LDAP_DN=CN=gitlab,CN=Users,DC=orgname,DC=global
LDAP_USER_FILTER=(|(sAMAccountName=${user})(userPrincipalName=${user}))
LDAP_VERSION=false
LDAP_EMAIL_ATTRIBUTE=userPrincipalName
LDAP_DISPLAY_NAME_ATTRIBUTE=cn

Steps To Reproduce
Steps to reproduce the behavior:

  1. Set auth method to ldap
  2. As new user click on login and enter username and password, proceed to login
  3. See page, that asks you to enter email, to be associated with account

Expected behavior
bookstack should log user and set email from LDAP_EMAIL_ATTRIBUTE field

Your Configuration (please complete the following information):

  • Exact BookStack Version (Found in settings): v0.26.2
  • PHP Version: 7.2.19
  • Hosting Method (Nginx/Apache/Docker): Apache

Additional context
Installation using install script on fresh ubuntu 18.04

Originally created by @ElvisTheKing on GitHub (Jul 3, 2019). **Describe the bug** User asked to input email during the first login even if there is email in AD record and LDAP_EMAIL_ATTRIBUTE is set correctly. We are using AD and email is stored in `userPrincipalName` field. One thing that can cause the problem is that our email domain is orgname.global , not all email parsers work with this kind of tld. Unfortunately I have no control over AD and can't test with another tld. **Email Confirmation** in settings is set to false. No domain restrictions set. ldap related part of .env: ``` LDAP_BASE_DN=dc=orgname,dc=global LDAP_DN=CN=gitlab,CN=Users,DC=orgname,DC=global LDAP_USER_FILTER=(|(sAMAccountName=${user})(userPrincipalName=${user})) LDAP_VERSION=false LDAP_EMAIL_ATTRIBUTE=userPrincipalName LDAP_DISPLAY_NAME_ATTRIBUTE=cn ``` **Steps To Reproduce** Steps to reproduce the behavior: 1. Set auth method to ldap 2. As new user click on login and enter username and password, proceed to login 3. See page, that asks you to enter email, to be associated with account **Expected behavior** bookstack should log user and set email from LDAP_EMAIL_ATTRIBUTE field **Your Configuration (please complete the following information):** - Exact BookStack Version (Found in settings): v0.26.2 - PHP Version: 7.2.19 - Hosting Method (Nginx/Apache/Docker): Apache **Additional context** Installation using install script on fresh ubuntu 18.04
OVERLORD added the 🚪 Authentication label 2026-02-05 00:24:19 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Jul 3, 2019):

Hi @ElvisTheKing,
Sorry to hear you have this issue.

I'm thinking this could be related to #1333.

Could you try updating your LDAP_EMAIL_ATTRIBUTE value to all lowercase, So:

LDAP_EMAIL_ATTRIBUTE=userprincipalname

Let me know how that goes.

@ssddanbrown commented on GitHub (Jul 3, 2019): Hi @ElvisTheKing, Sorry to hear you have this issue. I'm thinking this could be related to #1333. Could you try updating your `LDAP_EMAIL_ATTRIBUTE` value to all lowercase, So: ```env LDAP_EMAIL_ATTRIBUTE=userprincipalname ``` Let me know how that goes.
Author
Owner

@ElvisTheKing commented on GitHub (Jul 4, 2019):

@ssddanbrown Yes, it did the trick, thank you.

@ElvisTheKing commented on GitHub (Jul 4, 2019): @ssddanbrown Yes, it did the trick, thank you.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#1249