snipe / snipe-it

A free open source IT asset/license management system
https://snipeitapp.com
GNU Affero General Public License v3.0
11.02k stars 3.18k forks source link

LDAP authentication issue - user not found #3025

Closed austinsasko closed 7 years ago

austinsasko commented 7 years ago

Expected Behavior (or desired behavior if a feature request)

User is able to authenticate against LDAP


Actual Behavior

The user is shown an incorrect user/password page and the logs show "LDAP user not found in LDAP There was an error authenticating the LDAP user: Could not find user in LDAP directory"

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


Please provide answers to these questions before posting your bug report:

[2016-12-06 15:48:32] production.DEBUG: LDAP user not found in LDAP or could not bind [2016-12-06 15:48:32] production.ERROR: There was an error authenticating the LDAP user: Could not find user in LDAP directory [2016-12-06 15:48:32] production.DEBUG: Authenticating user against database. [2016-12-06 15:48:32] production.DEBUG: Local authentication failed. [2016-12-06 15:48:54] production.DEBUG: LDAP is enabled. [2016-12-06 15:48:54] production.DEBUG: Binding user to LDAP. [2016-12-06 15:48:55] production.DEBUG: LDAP user not found in LDAP or could not bind [2016-12-06 15:48:55] production.ERROR: There was an error authenticating the LDAP user: Could not find user in LDAP directory [2016-12-06 15:48:55] production.DEBUG: Authenticating user against database.

What furthers my confusion in this matter, is synchronizing LDAP works fine, and all users show up as expected under the setting uid; however, when attempting to authenticate under the same field (uid), the attempt is "not found". Test LDAP Connection Test LDAP It worked! LDAP settings:

image

snipe commented 7 years ago

Syncronizing and auth don't use the same LDAP methods. When you sync, you're authenticating with the admin credentials you supplied in the LDAP settings panel. When you login, you're logging in as whoever you're trying to login as.

Try using objectClass=inetOrgPerson as your LDAP filter.

snipe commented 7 years ago

(You should probably also use the SSL option for Jumpcloud: ldaps://ldap.jumpcloud.com)

austinsasko commented 7 years ago

I tried setting that as the LDAP filter and I get "Invalid DN syntax" when clicking test

snipe commented 7 years ago

We use Jumpcloud here. These are the settings that work for us:

screen shot 2016-12-06 at 1 34 28 pm screen shot 2016-12-06 at 1 34 39 pm
austinsasko commented 7 years ago

When attempting to use ldaps:// I get a " Could not bind to LDAP: Can't contact LDAP server" so I went with ldap:// but that left me with the issue of no users being found.

snipe commented 7 years ago

Quick status update - the authing user was not set to be able to bind in Jumpcloud, which is likely the reason LDAP thinks the user doesn't exist. Hopefully have more info tomorrow.

screen shot 2016-12-06 at 2 29 20 pm