mirror of
https://github.com/BookStackApp/BookStack.git
synced 2026-02-10 03:12:20 +03:00
v0.26.2 LDAP Group Sync for IDM instead of AD #1219
Closed
opened 2026-02-05 00:17:31 +03:00 by OVERLORD
·
10 comments
No Branch/Tag Specified
development
l10n_development
release
llm_only
vectors
v25-11
docker_env
drawio_rendering
user_permissions
ldap_host_failover
svg_image
prosemirror
captcha_example
fix/video-export
v25.12.3
v25.12.2
v25.12.1
v25.12
v25.11.6
v25.11.5
v25.11.4
v24.11.4
v25.11.3
v25.11.2
v25.11.1
v25.11
v25.07.3
v25.07.2
v25.07.1
v25.07
v25.05.2
v25.05.1
v25.05
v25.02.5
v25.02.4
v25.02.3
v25.02.2
v25.02.1
v25.02
v24.12.1
v24.12
v24.10.3
v24.10.2
v24.10.1
v24.10
v24.05.4
v24.05.3
v24.05.2
v24.05.1
v24.05
v24.02.3
v24.02.2
v24.02.1
v24.02
v23.12.3
v23.12.2
v23.12.1
v23.12
v23.10.4
v23.10.3
v23.10.2
v23.10.1
v23.10
v23.08.3
v23.08.2
v23.08.1
v23.08
v23.06.2
v23.06.1
v23.06
v23.05.2
v23.05.1
v23.05
v23.02.3
v23.02.2
v23.02.1
v23.02
v23.01.1
v23.01
v22.11.1
v22.11
v22.10.2
v22.10.1
v22.10
v22.09.1
v22.09
v22.07.3
v22.07.2
v22.07.1
v22.07
v22.06.2
v22.06.1
v22.06
v22.04.2
v22.04.1
v22.04
v22.03.1
v22.03
v22.02.3
v22.02.2
v22.02.1
v22.02
v21.12.5
v21.12.4
v21.12.3
v21.12.2
v21.12.1
v21.12
v21.11.3
v21.11.2
v21.11.1
v21.11
v21.10.3
v21.10.2
v21.10.1
v21.10
v21.08.6
v21.08.5
v21.08.4
v21.08.3
v21.08.2
v21.08.1
v21.08
v21.05.4
v21.05.3
v21.05.2
v21.05.1
v21.05
v21.04.6
v21.04.5
v21.04.4
v21.04.3
v21.04.2
v21.04.1
v21.04
v0.31.8
v0.31.7
v0.31.6
v0.31.5
v0.31.4
v0.31.3
v0.31.2
v0.31.1
v0.31.0
v0.30.7
v0.30.6
v0.30.5
v0.30.4
v0.30.3
v0.30.2
v0.30.1
v0.30.0
v0.29.3
v0.29.2
v0.29.1
v0.29.0
v0.28.3
v0.28.2
v0.28.1
v0.28.0
v0.27.5
v0.27.4
v0.27.3
v0.27.2
v0.27.1
v0.27
v0.26.4
v0.26.3
v0.26.2
v0.26.1
v0.26.0
v0.25.5
v0.25.4
v0.25.3
v0.25.2
v0.25.1
v0.25.0
v0.24.3
v0.24.2
v0.24.1
v0.24.0
v0.23.2
v0.23.1
v0.23.0
v0.22.0
v0.21.0
v0.20.3
v0.20.2
v0.20.1
v0.20.0
v0.19.0
v0.18.5
v0.18.4
v0.18.3
v0.18.2
v0.18.1
v0.18.0
v0.17.4
v0.17.3
v0.17.2
v0.17.1
v0.17.0
v0.16.3
v0.16.2
v0.16.1
v0.16.0
v0.15.3
v0.15.2
v0.15.1
v0.15.0
v0.14.3
v0.14.2
v0.14.1
v0.14.0
v0.13.1
v0.13.0
v0.12.2
v0.12.1
v0.12.0
v0.11.2
v0.11.1
v0.11.0
v0.10.0
v0.9.3
v0.9.2
v0.9.1
v0.9.0
v0.8.2
v0.8.1
v0.8.0
v0.7.6
v0.7.5
v0.7.4
v0.7.3
0.7.2
v.0.7.1
v0.7.0
v0.6.3
v0.6.2
v0.6.1
v0.6.0
v0.5.0
Labels
Clear labels
🎨 Design
📖 Docs Update
🐛 Bug
🐛 Bug
:cat2:🐈 Possible duplicate
💿 Database
☕ Open to discussion
💻 Front-End
🐕 Support
🚪 Authentication
🌍 Translations
🔌 API Task
🏭 Back-End
⛲ Upstream
🔨 Feature Request
🛠️ Enhancement
🛠️ Enhancement
🛠️ Enhancement
❤️ Happy feedback
🔒 Security
🔍 Pending Validation
💆 UX
📝 WYSIWYG Editor
🌔 Out of scope
🔩 API Request
:octocat: Admin/Meta
🖌️ View Customization
❓ Question
🚀 Priority
🛡️ Blocked
🚚 Export System
♿ A11y
🔧 Maintenance
> Markdown Editor
pull-request
Mirrored from GitHub Pull Request
No Label
🐕 Support
Milestone
No items
No Milestone
Projects
Clear projects
No project
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: starred/BookStack#1219
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking 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 @chris-jeon on GitHub (Jun 11, 2019).
I am quite new to Linux as well as LDAP configurations, so please bear with me. I have successfully installed BookStack. I successfully authenticated against LDAP, but can't figure out the LDAP Group Synchronization.
Problem
I am unable to connect and match the specified roles from BookStack onto groups of my company's IDM database; I assume that the problem lies within how I have my LDAP_USER_FILTER set as just LDAP_USER_FILTER=(&(uid=${user}). However, the only way for me to log-in with the correct credentials is to have that as my user filter.
I've already put in the specific CN of the groups into External Authentication ID's for those specific roles, and still have no luck. I've searched within every single issue whether it's closed or open for a similar issue, but most of them are dealing with Active Directories instead of IDM so no luck there for me either. I left the LDAP_DN and LDAP_PASS as false because I didn't necessarily need an admin to access BookStack.
I've tried several ways to reword the LDAP_USER_FILTER similar to #973 but because that issue deals with AD, I wasn't completely sure what to do.
Searching the query of my domain, our database doesn't use OU and only CN as its hierarchy (if you were wondering why I haven't used OU)
Potential issue
I am currently using OpenLDAP and I've found a module which had the memberof overlay without me setting it up, so I'm not exactly sure if that's the issue there.
@ssddanbrown commented on GitHub (Jun 12, 2019):
Hi @chris-jeon,
Thanks for the detail and sorry to hear you're experiencing difficulty setting this up.
I must admin my experience with LDAP is a little weak, only really used it to create and test the BookStack integration. If you query your LDAP server directly via command line are you able to see the memberof attributes in the results. Here's my query and output for reference (Sensitive data replaced):
I also use OpenLDAP in my testing instead of AD, I remember getting the
memberofattribute working correctly was a lot of pain, although much of that could well have been my inexperience with such systems.@chris-jeon commented on GitHub (Jun 14, 2019):
@ssddanbrown Thank you for the quick reply, yes I am able to see what the memberof attributes are. I'm just confused on how to set it up on the LDAP user_filter portion on the .env file to integrate the roles for the LDAP accounts.
@ssddanbrown commented on GitHub (Jun 14, 2019):
@chris-jeon The
LDAP_USER_FILTERis a generic search that BookStack uses when looking up users. This does not really need to consider roles at all.Upon login, with group sync enabled, BookStack will look up the user, using that filter, then fetch their groups via the same query but requesting the
memberOfattribute. BookStack will then iterate over the returned groups to match them with system roles.@chris-jeon commented on GitHub (Jun 14, 2019):
@ssddanbrown
On the .env file, I would list out the necessary filters like this to LDAP_USER_FILTER:
If I try to log-in with the filter just like above, I get the error saying
When I write the filter without the "uid" portion, I get the Bad Search Filter with APP_DEBUG on.
I just need to know how to correctly write out either the memberOf portion or if i need to use the objectClass portion onto the user_filter?
@ssddanbrown commented on GitHub (Jun 15, 2019):
@chris-jeon In your example filter above you have
${users}included within it. This should be${user}.Have you tried using your
LDAP_USER_FILTERvia command line, replacing${user}with a login username, to see if you get results there?Just to confirm, you only need to list groups in the
LDAP_USER_FILTERif you are purposefully trying to limit any kind of access to BookStack to certain groups. Alternatively you could allow all LDAP users access but only map roles to certain groups so non-matches are left without any permissions.@chris-jeon commented on GitHub (Jun 17, 2019):
@ssddanbrown Sorry, yeah in that filter above, I quickly had changed it to ${user} afterwards, but still doesn't end up working.
Yes, I have tried using my user_filter replaced with my own login username, which only allows my information to be logged in.
If all LDAP_USER_FILTER needs are groups, I'll try it again, but now that I think about it, I'm not exactly sure if the problem lies in the OpenLDAP server not having the memberOf overlay. I assumed because the IDM my company uses is already set with existing log-in information, I wasn't sure if that applied in my case.
If the above sentence is a bit confusing, what I essentially mean is that I never dealt with the memberOf overlay (setting up the slap.d configuration) because I assumed that some of the steps in order to complete the memberOf overlay deals with inputting user accounts which didn't make sense to me as I wouldn't need to if I already have existing accounts through IDM.
@chris-jeon commented on GitHub (Jun 18, 2019):
Update:
I've tried putting in just the groups within the user_filter, but had no luck, still gives me credential issues. Now as I'm losing my hope, I can't 100% tell if it's a syntax problem, or a problem within the IDM of how the memberOf is set up for the specific groups.
My ldapsearch queries show all the necessary groups for a user, and I copy it down to the LDAP_USER_FILTER word for word, and giving me credential mismatch, confuses me to why it doesn't work.
One of my coworkers thinks that it's just a syntax issue, but I've been trying to tackle this problem through many tries on fixing the syntax, but have had no luck :/
@ssddanbrown commented on GitHub (Jun 20, 2019):
@chris-jeon Sorry to hear you have not yet been able to solve this and apologies for the limited support I can provide here.
Does login work if you use a really simple LDAP_USER_FILTER, like the default
LDAP_USER_FILTER=(&(uid=${user}))?Knowing that would confirm if this is anything to do with the
memberOfoverlay or group sync.@chris-jeon commented on GitHub (Jun 21, 2019):
Update
@ssddanbrown
I've figured out the problem on why it wasn't group syncing. All this time, I thought it was just a syntax error (was spinning my wheels for about 3 days) on
LDAP_USER_FILTER.Researching even more into LDAP, I figured out that the IDM that my company uses deals with Posixgroups. Meaning, the memberof overlay is required to set up the group sync, but looking more into it, it's apparently a difficult and tedious process to get it working.
So, I've basically given up on the group sync for now, since BookStack is up and running, only problem is when people sign-in for the first time, they won't be assigned the roles according to their groups. Thank you for your support regardless of the result!
@ssddanbrown commented on GitHub (Jun 22, 2019):
@chris-jeon Glad to hear you got to the bottom of the mystery!
Since there doesn't appear to be an issue or omission of BookStack itself I'll close this issue.