Fixed #15926 : wrong LDAP service account login behavior #15927
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Currently, credentials used to bind to LDAP server are the one entered in login form, (username = uid).
Bind fails because users cannot directly bind to ldap using their uid. They must use DN to bind.
Instead of trying to bind to ldap server with users credentials, a search should be made using bind_user service account and user_filter to find the user.
Then, we should save the user DN and try to bind to the LDAP using DN
Fixes #15926
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Create an openldap server
Create an user witch a uid field (user can only bind to ldap using DN.
Configure user login with uid.
Snipe-it can sync users and authentication works
Test Configuration: dev docker compose build
Checklist: