snipe-it icon indicating copy to clipboard operation
snipe-it copied to clipboard

Bad search filter when setting LDAP filter to pull members of a group

Open jmillerl opened this issue 7 years ago • 4 comments

Please confirm you have done the following before posting your bug report:

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:

  1. Set LDAP Filter similar to (&(objectCategory=Person)(memberOf=CN=Group,OU=Group OU,DC=domain,DC=com))
  2. Click on 'People'
  3. Click on 'LDAP Sync'
  4. 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 image image

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 image

jmillerl avatar Jun 21 '19 14:06 jmillerl

try again after deleting the parentheses at the beginning and end

example: &(objectCategory=Person)(memberOf=CN=Group,OU=Group OU,DC=domain,DC=com)

aliboduroglu avatar Aug 06 '19 19:08 aliboduroglu

Error: when I try to do LDAP User Sync fails with this error "Error: Function ldap_control_paged_result() is deprecated" image

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.

sujith-cy avatar Jul 23 '20 15:07 sujith-cy

Was this ever resolved? I have the same issue

nyamoga9 avatar Oct 19 '20 16:10 nyamoga9

@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.

DJMikeGuzman avatar Jan 12 '21 02:01 DJMikeGuzman