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 sync successfully but cannot login by ldap #8621

Closed
maodahua opened this issue Oct 27, 2020 · 30 comments
Closed

LDAP sync successfully but cannot login by ldap #8621

maodahua opened this issue Oct 27, 2020 · 30 comments
Assignees
Labels

Comments

@maodahua
Copy link

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

Describe the bug
In v5.0.4 I can sync by ldap, but I still login some account by ldap

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'login page'
  2. Type username and password
  3. Click on 'login'
  4. Show 'user or password errors(in Chinese)', But password 10000% is right and many times notice wrong the account not forbidden。

Expected behavior
domain account can login system after ldap sync

Screenshots
image

Server (please complete the following information):

  • Snipe-IT 5.0.4
  • OS: [ CentOS]
  • Web Server: [Apache]
  • PHP Version 7.2.16

Desktop (please complete the following information):

  • OS: [macOS 10.15.7]
  • Browser [safari]
  • Version [14]

Error Messages
[10:44:31] LOG.debug: LDAP is enabled.
DEBUGLOG[10:44:31] LOG.debug: Attempting to log user in by LDAP authentication.
DEBUGLOG[10:44:31] LOG.debug: LDAP user login: Unable to validate user credentials!
DEBUGLOG
[10:44:31] LOG.debug: There was an error authenticating the LDAP user: Unable to validate user credentials!
DEBUGLOG
[10:44:31] LOG.debug: Authenticating user against database.
DEBUGLOG
[10:44:31] LOG.debug: Local authentication failed.

Additional context

  • upgrade from 4.9.5 to V 5.0.x can't login
@welcome
Copy link

welcome bot commented Oct 27, 2020

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

@Gowei88
Copy link

Gowei88 commented Oct 28, 2020

@maodahua 你好,我也有一样的问题,请问你解决了吗?
Hello, I have the same problem, have you solved it?

@maodahua
Copy link
Author

@hssz202pgw Not yet, I'm waiting snipe solve the issue.

@Gowei88
Copy link

Gowei88 commented Oct 28, 2020

@hssz202pgw Not yet, I'm waiting snipe solve the issue.

我的环境基本和你一致,web服务器用的nginx,怀疑可能是中文版的原因?

@maodahua
Copy link
Author

@hssz202pgw Not yet, I'm waiting snipe solve the issue.

我的环境基本和你一致,web服务器用的nginx,怀疑可能是中文版的原因?

I don't think so. I modify the language to English and nothing helpd.
As I know, the Chinese is a language pack in code.

@snipe
Copy link
Owner

snipe commented Oct 28, 2020

When possible, please post in English. (It’s okay if you have to use google translate. Bad translations are better than nothing.)

We are unable to reproduce this issue right now. LDAP logins are working as expected on our end. We’re looking into it, but it’s very hard to fix a bug you can’t reproduce :(

@maodahua
Copy link
Author

When possible, please post in English. (It’s okay if you have to use google translate. Bad translations are better than nothing.)

We are unable to reproduce this issue right now. LDAP logins are working as expected on our end. We’re looking into it, but it’s very hard to fix a bug you can’t reproduce :(

I can't find some log to show you even thought I turn on the debug mode.
And It's very easy reproduce in my instance. I just add a user in AD and do ldap sync in system. Everything OK, but the new user can't login. Notice me the username or password error. But username is correct. I reset password and resync, still can not login...

@maodahua
Copy link
Author

I create a new server and fresh install snipeit on it and config ldap.
I can sync. But the same user cannot login the new system.
example:
User1 can login old system still can not login new system
User2 can not login old system still can not login new system

And I found when the first login successfully in new system, The user Note will add "last login from ldap2". when I change ldap setting and resync it dispear.
image
image
image
above is my setting.

@Chetyre
Copy link

Chetyre commented Oct 29, 2020

For what it's worth, I'm seeing the same issue with our LDAP accounts. Noticed initially when we upgraded to 5.0.1 last week and still occurring on 5.0.4. We are not using active directory but same symptoms. I run a test sync and it shows a successful connect & bind. Running an actual sync shows a successful LDAP import. But when you go to log in with any of the LDAP accounts I receive a "username or password incorrect" message. Tested this with a few different ldap accounts and these logins were working before we updated to 5.x.

LDAP error

edit: we are also running our server on CentOS, and PHP version 7.2.27 installed. Ran upgrade.php, I believe our previous version was 4.7.8.

2nd edit: I think I was able to fix this for now by changing our auth query from uid= to cn=

@someonept
Copy link

someonept commented Nov 3, 2020

Hi
I have the same problem

image

LDAP Sync works, but i cant login
Have you solved it?

@maodahua
Copy link
Author

maodahua commented Nov 4, 2020

Hi
I have the same problem

image

LDAP Sync works, but i cant login
Have you solved it?

I have no idea. So I install a old version snipeit and restore the backupdata before the upgrade.

@firsakura
Copy link

I have same issue here, i can get LDAP synced and imported usere successfully. but when I try to login with one of imported AD accounts, it warns me the username or password is incorrect. Wondering if it's a known bug, or there is a fix already?

@maodahua
Copy link
Author

maodahua commented Nov 5, 2020

I have same issue here, i can get LDAP synced and imported usere successfully. but when I try to login with one of imported AD accounts, it warns me the username or password is incorrect. Wondering if it's a known bug, or there is a fix already?

V5.0.x have the issus. I can find a fix still now.

@someonept
Copy link

Hi
I have the same problem
image
LDAP Sync works, but i cant login
Have you solved it?

I have no idea. So I install a old version snipeit and restore the backupdata before the upgrade.

ok, did you manage to solve this problem with the downgrade?
Which version are you using now ( working version) ?

@maodahua
Copy link
Author

maodahua commented Nov 5, 2020

Hi
I have the same problem
image
LDAP Sync works, but i cant login
Have you solved it?

I have no idea. So I install a old version snipeit and restore the backupdata before the upgrade.

ok, did you manage to solve this problem with the downgrade?
Which version are you using now ( working version) ?

I use V4.9.55 now. V4.x is work fine, I use this version for produce

@firsakura
Copy link

Hi
I have the same problem
image
LDAP Sync works, but i cant login
Have you solved it?

I have no idea. So I install a old version snipeit and restore the backupdata before the upgrade.

ok, did you manage to solve this problem with the downgrade?
Which version are you using now ( working version) ?

Mine is

Snipe-IT versionv5.0.5-pre build 5457
PHP Version7.2.34
Laravel Version6.18.10

I just built it up, never tried lower versions.

@someonept
Copy link

Hi
I have the same problem
image
LDAP Sync works, but i cant login
Have you solved it?

I have no idea. So I install a old version snipeit and restore the backupdata before the upgrade.

ok, did you manage to solve this problem with the downgrade?
Which version are you using now ( working version) ?

Mine is

Snipe-IT versionv5.0.5-pre build 5457
PHP Version7.2.34
Laravel Version6.18.10

I just built it up, never tried lower versions.

Is this Snipte-IT version ( Snipe-IT versionv5.0.5-pre build 5457 ) working correctly ?
Does this problem still not occur?

@firsakura
Copy link

Hi
I have the same problem
image
LDAP Sync works, but i cant login
Have you solved it?

I have no idea. So I install a old version snipeit and restore the backupdata before the upgrade.

ok, did you manage to solve this problem with the downgrade?
Which version are you using now ( working version) ?

Mine is
Snipe-IT versionv5.0.5-pre build 5457
PHP Version7.2.34
Laravel Version6.18.10
I just built it up, never tried lower versions.

Is this Snipte-IT version ( Snipe-IT versionv5.0.5-pre build 5457 ) working correctly ?
Does this problem still not occur?

we still have this issue on this version ( Snipe-IT versionv5.0.5-pre build 5457 )

@snipe snipe changed the title LDAP sync successfully but can login by ldap LDAP sync successfully but cannot login by ldap Nov 10, 2020
@snipe
Copy link
Owner

snipe commented Nov 10, 2020

@uberbrady can you take a look?

@VanillaNinjaD
Copy link

After my upgrade to v5 I had many users unable to login until I selected the LDAP option for "Append domain name to username field". This was never required for my LDAP configuration prior to v5 and we have been using Snipe-IT since v2.x

Give it a try, I hope it helps someone

image

@uberbrady
Copy link
Collaborator

@VanillaNinjaD the migration that runs to get your database schema migrated from v4 to v5 should automatically set that variable during the migration process - but it looks like that didn't happen for you for some reason.

@VanillaNinjaD
Copy link

@uberbrady I was one of the users bit by the weird migrations issue that some of us had during the v5 upgrade. I'm sure that had something to do with it.

I only pointed it out since I noticed the screenshots above have "This is an Active Directory Server" selected but do not have the "Append domain name to username field" selected

@maodahua
Copy link
Author

Hello everyone, today I test V5.0.7 and when I check the box "Append domain name to username field". LDAP test successfully and I can login! but in old version, No matter whether I check it or not, I can’t log in.
image
So, for now I think this issue have been fixed and I will close the issue.

@snipe
Copy link
Owner

snipe commented Nov 17, 2020

@maodahua Great news! Thanks so much for testing that so quickly!

@jmarquezalfaro
Copy link

Saludos,

Correcto. Se debe seleccionar:
image

@TheNamelessSir
Copy link

Hi, i also had this problem solved by checking the Append domain name box.

Thank you!

@aice09
Copy link

aice09 commented Jul 29, 2022

Please try the following settings. I hope this help you guys.

ldapsnipeitsettings

@Aliko47
Copy link

Aliko47 commented Dec 6, 2022

Hi all,
I also faced the same issue using LDAP via AD. Changing LDAP Authentication query from 'uid=' to 'sAMAccountName=' fixed this issue.

@snipe snipe reopened this Dec 6, 2022
@snipe snipe closed this as completed Dec 6, 2022
@kmccoycoc
Copy link

@Aliko47, that fixed my issue. I used to have the "LDAP Authentication query" field as uid=userPrincipalName I had to change it to userPrincipalName= I guess they changed the syntax in an update, and didn't update the documentation?

@brichardson1991
Copy link

brichardson1991 commented Feb 1, 2023

I concur with @aice09 and @Aliko47.

LDAP was working fine for ages now it's fixed changing the LDAP Authentication Query to samaccountname=

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

No branches or pull requests