Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

ZupitDevs
Copy link

I've been struggling with the problem the whole day:
I Was using the following configuration, because I wanted to first bind, using the authenticating user credentials, and then perform an ldap search.

This is the configuration i'm using

AUTH_LDAP_BIND_AS_AUTHENTICATING_USER = True
AUTH_LDAP_USER_SEARCH = LDAPSearch("OU=ex1,OU=example2,OU=ex3,DC=example,DC=ex,DC=com",
                                   ldap.SCOPE_SUBTREE,
                                   "(userprincipalname=%(user)s)")

Which caused me the error.

The fix was to actually bind with the authenticating user when AUTH_LDAP_BIND_AS_AUTHENTICATING_USER is set to True and when not using AUTH_LDAP_USER_DN_TEMPLATE but instead using AUTH_LDAP_USER_SEARCH.

Note that I had to add at line #479 because self.dn is not required to be set nor should be read otherwise a binding with AUTH_LDAP_BIND_DN and AUTH_LDAP_BIND_PASSWORD is done.

@ZupitDevs ZupitDevs changed the title BIND_AS_AUTHENTICATING_USER should bind with the authenticating user also when using the Search/Bind configuration WIP: BIND_AS_AUTHENTICATING_USER should bind with the authenticating user also when using the Search/Bind configuration Mar 18, 2020
@francoisfreitag
Copy link
Member

Hi,

If you are still interested in fixing this issue, can you please add a test to demonstrate the issue and exercise the code?

@xkilian
Copy link

xkilian commented Nov 3, 2021

@ZupitDevs Any chance you can complete a test so the Pull request gets merged?

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

Successfully merging this pull request may close these issues.

4 participants