Improve LDAP user binding with dynamic DN resolution #16981
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.
TL;DR supports broader LDAP Base Bind DN
This is a dirty hack to automatically resolve the correct userDN in LDAP if other OUs are under the base DN.
For example, your LDAP structure might look like this:
ou=SOMEGROUP01,ou=People,dc=domain,dc=com
ou=SOMEGROUP02,ou=People,dc=domain,dc=com
ou=SOMEGROUP03,ou=People,dc=domain,dc=com
You would be limited to setting the Base Bind DN to a specific OU, such as ou=SOMEGROUP01,ou=People,dc=domain,dc=ch. Users in other groups/OUs under ou=People,dc=domain,dc=com would not be able to log in.
With the fix, all users under the base dn ou=People,dc=domain,dc=com can now log in. sysadmin can now just define a broad base DN and the correct userDN is automagically found ex. uid=username,ou=SOMEGROUP01,ou=People,dc=domain,dc=com in our case.