LDAP Filter doesn't work with memberOf attribute
Debug mode
- [x] I have enabled debug mode
- [X] I have read checked the Common Issues page
Describe the bug
Hello,
for our enterprise Snipeit server, we have enabled LDAP Login, but only want users of a specific group to be able to log in (e.g snipeitusers). However, it seems, like the memberOf attribute in the filter doesn't work, because every user can log in.
Here's the filter that we use:
&(memberof=CN=snipeitusers,OU=groups,OU=some,DC=ad,DC=org,DC=com)
I have also tried different variations of this filter, but no luck. Is this a genuine bug or am I making a mistake here?
Reproduction steps
- Enable LDAP
- Use a Filter with memberOf=... attribute
Expected behavior
Access is only granted to users within the "snipeitusers" group, but not to anyone else.
Snipe-IT Version
v5.2.0
Operating System
Debian 11
Web Server
Apache2
PHP Version
7.4
Operating System
Windows 10
Browser
Chrome
Version
94.04
Additional context
This is a fresh install on a Bullseye VM, using NGINX as reverse proxy to Apache2 as webserver. Everything works fine, except for the LDAP filter.
👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.
Seems, like I'm not the first person, to stumble upon this issue... There is also a suggested solution in #6674
My filter forking fine: (&(objectclass=person)(memberof=CN=grupname,OU=app,OU=Group,DC=example,DC=com))
Похоже, я не первый, кто столкнулся с этой проблемой... В [#6674 также есть предлагаемое решение.]
I have exactly the same problem! I tried to edit the file /var/www/html/app/Models/Ldap.php as described in #6674, but unfortunately it didn't work :(
@djooberlee this ticket is pretty old, and the OP is using Snipe-IT that is many versions behind. I'm not sure their issue is still valid in v6.
@snipe the problem hasn't gone away. Because the filter and synchronization work as expected, but this filter does not work when logging in. Any ldap user can log in, not just a member of the group specified in the filter. Everything is exactly as described by OP.
@djooberlee what version are you using?
@snipe v5.4.4
UPD: My apologies! Version 6.0.1 does not have this problem!