Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ldap_search(): Search: Bad search filter #11979

Open
2 tasks done
Speed1 opened this issue Oct 14, 2022 · 1 comment
Open
2 tasks done

ldap_search(): Search: Bad search filter #11979

Speed1 opened this issue Oct 14, 2022 · 1 comment

Comments

@Speed1
Copy link

Speed1 commented Oct 14, 2022

Debug mode

Describe the bug

Hi,

since upgraded from 5.4 to 6.0.11 my LDAP Filter query doesn't work anymore. The Filter queries all users of an Active Directory group.

My LDAP Filter query:memberof:1.2.840.113556.1.4.1941:=<groupDN>
Error Test LDAP Login: ldap_search(): Search: Bad search filter
User error on login: Error The username or password is incorrect.

When I replace the LDAP Filter query with the suggested one &(sAMAccountType=805306368)(!(userAccountControl:1.2.840.113556.1.4.803:=2)) everything works as expected.

Test LDAP sync works as expected.

Let me know if you need further info.

Reproduction steps

  1. Setup LDAP in SnipeIT
  2. Create an Active Directory Group
  3. As LDAP Filter enter memberof:1.2.840.113556.1.4.1941:=
  4. Test LDAP Login and you will get ldap_search(): Search: Bad search filter
  5. Already imported user can't login and get "Error The username or password is incorrect."

Expected behavior

No error on LDAP Login and already imported user can login again

Screenshots

No response

Snipe-IT Version

6.0.11

Operating System

Centos

Web Server

Apache

PHP Version

7.4.30

Operating System

No response

Browser

No response

Version

No response

Device

No response

Operating System

No response

Browser

No response

Version

No response

Error messages

No response

Additional context

No response

@Speed1
Copy link
Author

Speed1 commented Oct 14, 2022

It seems that it has something to do with the spaces in the Group DN Path of the filter. When I change the Filter this way it works as expected:
&(memberof:1.2.840.113556.1.4.1941:=<groupDN with spaces>)(sAMAccountType=805306368)(!(userAccountControl:1.2.840.113556.1.4.803:=2))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant