-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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 Invalid Credentials - Works on XAMPP, not on Docker #13500
Comments
I would try our own image - snipe/snipe-it - you might have better luck with that. I don't know anything about the linuxserver one. |
It appears I might have a deeper issue anyway. Even though I tested while I was writing this help post, now even the XAMPP install is saying invalid credentials. Makes no sense, but definitely does not appear to be a Snipe-It problem. |
After saving the LDAP settings, should the LDAP Bind Password blank be empty again? Or should there still be dots? It makes sense if it's only stored in the database and not repopulated in the form after saving. Just making sure. |
We keep it blank so we know it shouldn’t be modified when you save it. If you enter something new, it will save. If it’s blank, we don’t modify it. |
Okay. Makes sense. |
So now I'm trying to restore to an earlier backup and it's like it's completely resetting the install. Goes back to the Pre-Flight screen and when I finally log in, even the visual settings are reset. All assets are gone, etc. |
What’s in your app logs? |
Where are they located? I see the storage>logs folder, but hat just has a laravel.log file. |
Depending on how mysql was configured, we do sometimes see some stray |
These are the only 3 entries for today in the laravel log: Maybe hinting that it couldn't restore the user? |
After restore, there are tables in the database. I have not yet clicked the Create Database Tables button. |
What’s your log_level set to in your env? You might want to set it to debug so you can see a bit more output. |
I did a manual import of the sql dump and that got it back up. And now testing LDAP works again. Go figure. So now back to figuring out why it works here, but not on docker. :-D |
HA! I got it! Now that the XAMPP install was restored, I realize what happened. I have Bitwarden and it had auto-filled the username and password blanks for the LDAP settings with the credentials I use to log into Snipe-It. While technically "correct" for my Windows/LDAP user, it had dropped the FQDN from the end of the username needed to log into LDAP. I had already set Bitwarden to not auto-fill, but the damage was already done. |
AHHHH - nice sleuthing! On the user create screen, we implement a few tricks to prevent auto filling (since we don’t want to overwrite a random new user’s password with the password of the logged in user) - I don’t recall if we do that on the LDAP screen, but we probably should. |
If you do somehow prevent it on the LDAP screen, Bitwarden didn't care and filled it in anyway. :-D |
I don’t think we implemented it there, but it should be easy enough to do. The tricks we use don’t work across all browsers unfortunately, but we’ve implemented every trick we know on the users’s screen. (Using hidden fields that the browser will fill in but that we don’t save so they get overwritten, using autofill=“off”, etc) so I think we can give that a try on the settings page. We have a PR in testing that rewrites the LDAP interface, so I’ll probably add it to that versus the current LDAP page. |
Well crap. We already have the hidden fields. Good for us for thinking ahead, bad news that it doesn't seem to have worked in your case. snipe-it/resources/views/settings/ldap.blade.php Lines 41 to 43 in b93adf4
I do see that we're using the wrong value for form autocompleting:
But that tag is largely ignored by most browsers anyway, so I'm not sure it will handle your issue. We might be able to disable that field unless it's clicked into, the way we do on the users edit/clone screen. |
Thanks, @snipe |
…_on_ldap_password Fixed #13500 - Try to prevent the browser from pre-filling the LDAP password
That field is actually called I did merge the changes I made to master, so if you update to latest on master you might give that another go. Other than that, I'm afraid I'm out of ideas :( |
Thanks, @snipe ! I already disabled autofill on the Snipe-It url, so I don't have the problem anymore. I was mostly just speculating on what you'd be up against trying to prevent password managers from autofilling. They can be persistent! :-) |
Debug mode
Describe the bug
This isn't really a bug, as far as I know. I just need some help/insight.
I've had Snipe-it running on a XAMPP server for over a year, no problems. I decided to set it up on Docker instead (linuxserver image on Synology), but I can't get it to connect to our Windows Server LDAP server with the exact same settings. Says Invalid credentials.
From the container console, I can ping the LDAP server via IP and name. So I know the container can "see" the LDAP server.
I've tried the credentials that the XAMPP install is using and our main domain admin account. No luck.
I've checked the php info on the container and ldap is enabled.
I'm running Snipe-it version 6.1.2 on docker and 6.0.13 on XAMPP.
Any ideas what I may be missing?
Reproduction steps
Expected behavior
Successful connection to LDAP server as on XAMPP installation.
Screenshots
No response
Snipe-IT Version
v6.1.2 build 10938 (g32747cafd)
Operating System
Docker
Web Server
Apache via Docker
PHP Version
8.1.22
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
The text was updated successfully, but these errors were encountered: