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

Ldap auth is not working anymore

Open noose opened this issue 5 years ago • 8 comments

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:


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/logs and 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!
Screenshot 2021-01-20 at 13 55 33
  • 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

noose avatar Jan 20 '21 13:01 noose

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

welcome[bot] avatar Jan 20 '21 13:01 welcome[bot]

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.

uchida140964 avatar Jan 22 '21 03:01 uchida140964

Tried - without luck. If I check that checkbox snipe-it cannot find user in the AD.

noose avatar Jan 27 '21 12:01 noose

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

bthomason2087 avatar Feb 18 '21 18:02 bthomason2087

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.

image

image

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.

Bh0di avatar Apr 19 '21 12:04 Bh0di

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)

jumpgh avatar Apr 26 '21 10:04 jumpgh

Having the same situation here. using Univention UCS with snipe-it 5.1.4 container. ldap Syncronization is working yet Ldap login test failing.

Screenshot 2021-05-05 at 9 55 37 AM

peg-africa avatar May 05 '21 10:05 peg-africa

@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

Alphaex1 avatar May 06 '21 09:05 Alphaex1