Ldap auth is not working anymore
Expected Behavior (or desired behavior if a feature request)
I want to be able to login with ldap (AD to be specific).
Actual Behavior
Not working :-)
Error message: Invalid credentials .
Btw, maybe you can add AdLdap::setLogger() when debug mode is enabled? ;-)
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
Provide answers to these questions:
-
Is this a fresh install or an upgrade? Fresh / upgrade - doesn't matter.
-
Version of Snipe-IT you're running Last working version: 4.9.5. After upgrading to the 5.0+ (I've tested all...) stopped working.
-
Version of PHP you're running Provided with the container (https://hub.docker.com/r/snipe/snipe-it)
-
Version of MySQL/MariaDB you're running 5.7
-
What OS and web server you're running Snipe-IT on OS on host: centos. And your container.
-
What method you used to install Snipe-IT (install.sh, manual installation, docker, etc) Docker (https://hub.docker.com/r/snipe/snipe-it)
-
WITH DEBUG TURNED ON, if you're getting an error in your browser, include that error
production.DEBUG: LDAP user login: Unable to validate user credentials!
-
What specific Snipe-IT page you're on, and what specific element you're interacting with to trigger the error Login page and
/admin/ldap -
If a stacktrace is provided in the error, include that too. nope
-
Any errors that appear in your browser's error console. nope
-
Confirm whether the error is reproducible on the demo: https://snipeitapp.com/demo. nope
-
Include any additional information you can find in
storage/logsand your webserver's logs.
[2021-01-20 12:57:29] production.DEBUG: LDAP is enabled.
[2021-01-20 12:57:29] production.DEBUG: Attempting to log user in by LDAP authentication.
[2021-01-20 12:57:29] production.DEBUG: LDAP user login: Unable to validate user credentials!
[2021-01-20 12:57:29] production.DEBUG: There was an error authenticating the LDAP user: Unable to validate user credentials!
-
Include what you've done so far in the installation, and if you got any error messages along the way. After upgrading from the v4.9 ldap stopped working. I did a fresh install of the 5.x (checked all versions) but I had to downgrade to the 4.9 because it's last version where it's working.
-
Indicate whether or not you've manually edited any data directly in the database Didn't touched db.
Please do not post an issue without answering the related questions above. If you have opened a different issue and already answered these questions, answer them again, once for every ticket. It will be next to impossible for us to help you.
https://snipe-it.readme.io/docs/getting-help
👋 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.
This seems to be the same problem that happened to me before. #8684 Try to set the LDAP settings to the same as it was working with v4.9.5 and check the "Append domain name to username field" checkbox. This worked for me.
Tried - without luck. If I check that checkbox snipe-it cannot find user in the AD.
@noose
My settings match yours in version 5.1 with one exception, my LDAP filter is "&(sAMAccountType=805306368)(!(userAccountControl:1.2.840.113556.1.4.803:=2))" remove quotations
I can successfully log in users via LDAP/AD
(Also, it requires the "append domain to user" to work for me)
I have kinda the same problem as in #8684. But your '"fix" mentioned there dosen't work in my case. LDAP-Sync works, but I still can't login with my ldap user.


It's a fresh install and the ldap settings are correct, double checked. We use other applications with ldap and the login works just fine.
Trying to integrate with iRedMail-LDAP, got same issue
LDAP Filter: &(objectclass=mailuser) Username Field: mail LDAP Authentication query: "mail="
Are there any ways to log resulting LDAP query ?
p.s. docker image latest (v5.1.x)
Having the same situation here. using Univention UCS with snipe-it 5.1.4 container. ldap Syncronization is working yet Ldap login test failing.

@noose
My settings match yours in version 5.1 with one exception, my LDAP filter is "&(sAMAccountType=805306368)(!(userAccountControl:1.2.840.113556.1.4.803:=2))" remove quotations
I can successfully log in users via LDAP/AD
(Also, it requires the "append domain to user" to work for me)
This Solved my Problems :) append domain to user ist important