Fixed #12331: Change the way userDn is build for non-AD login#13972
Fixed #12331: Change the way userDn is build for non-AD login#13972P-EB wants to merge 1 commit intogrokability:masterfrom
Conversation
Currently, snipe-it relies on a manually crafted user DN to bind a user and therefore check if they exist, and *then*, it searches in LDAP if the user is found when applying the filter. This works nicely when the base_dn is "fixed". In a company with multiple business lines or business units, though, there might be more than one OU for LDAP users, and in that case, crafting the DN manually might fail. This patch aims at crafting the userDn from a ldap_search, assuming the user field is unique. If more than 1 user is found, the user field is not unique and the login method will throw. This increases significantly the LDAP login flexibility. Fixes grokability#12331
|
💖 Thanks for this pull request! 💖 We use semantic commit messages to streamline the release process and easily generate changelogs between versions. Before your pull request can be merged, you should update your pull request title to start with a semantic prefix if it doesn't have one already. Examples of commit messages with semantic prefixes:
Things that will help get your PR across the finish line:
We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can. |
PR Summary
|
|
I took a swing at re-implementing this functionality here: #17832 - does this doe the same trick for you? |
Currently, snipe-it relies on a manually crafted user DN to bind a user and therefore check if they exist, and then, it searches in LDAP if the user is found when applying the filter.
This works nicely when the base_dn is "fixed". In a company with multiple business lines or business units, though, there might be more than one OU for LDAP users, and in that case, crafting the DN manually might fail.
This patch aims at crafting the userDn from a ldap_search, assuming the user field is unique. If more than 1 user is found, the user field is not unique and the login method will throw.
This increases significantly the LDAP login flexibility.
Fixes #12331
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
Test Configuration:
Checklist: