Bad search filter when setting LDAP filter to pull members of a group
Please confirm you have done the following before posting your bug report:
- [ x] I have enabled debug mode
- [x ] I have read checked the Common Issues page
Describe the bug
When attempting an LDAP Sync with an LDAP filter to find members of a group, I'm receiving a Error: ldap_search(): Search: Bad search filter error.
To Reproduce Steps to reproduce the behavior:
- Set LDAP Filter similar to
(&(objectCategory=Person)(memberOf=CN=Group,OU=Group OU,DC=domain,DC=com)) - Click on 'People'
- Click on 'LDAP Sync'
- Click ' Synchronize'
Expected behavior Members of the group specified in the LDAP filter are synced into SnipeIT. This exact query returns desired results if ran in ADUC
Screenshots

Server (please complete the following information):
- Snipe-IT Version v4.6.13 build 3985 (g5f3147cf3)
- OS: CentOS 7
- Web Server: Apache
- PHP Version 7.2.19
Error Messages

try again after deleting the parentheses at the beginning and end
example: &(objectCategory=Person)(memberOf=CN=Group,OU=Group OU,DC=domain,DC=com)
Error: when I try to do LDAP User Sync fails with this error "Error: Function ldap_control_paged_result() is deprecated"

System Information: XAMPP v.3.2.4 Snipe-IT version - v4.9.3 build 4395 (g9a2440dc4) PHP Version7.1.33-16+ubuntu16.04.1+deb.sury.org+1 Laravel Version5.5.49 Software LicenseAGPL3
Good thing is "Test LDAP Sync" works well and also "Test LDAP Login" but when i try to do a LDAP sync fails.
Please assist.
Was this ever resolved? I have the same issue
@aliboduroglu
I did run into the known issue of running SNIPE on PHP 7.4 and adding and @ symbol on line 289 (https://github.com/snipe/snipe-it/issues/7661). Today I followed the steps in issue and LDAP now works.
After getting past this, I added your example in the LDAP Search: &(objectCategory=Person)(memberOf=CN=Group,OU=Group OU,DC=domain,DC=com) And it worked, however when i sync, my users who are part of the group, they do now appear and Snipe looks to be synced yet I still get the error at the top;
" Error: Could not bind to LDAP: Can't contact LDAP server "
Not sure what other problems might rise from this.