Skip to content
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

Escaping commas from CN #139

Closed
pbecotte opened this issue Aug 28, 2019 · 2 comments · Fixed by #267
Closed

Escaping commas from CN #139

pbecotte opened this issue Aug 28, 2019 · 2 comments · Fixed by #267
Labels

Comments

@pbecotte
Copy link

pbecotte commented Aug 28, 2019

Spent a while trying to get this to work today. Turned out the issue is this snippet of code-

        if self.lookup_dn:
            if str(self.lookup_dn_user_dn_attribute).upper() == "CN":
                # Only escape commas if the lookup attribute is CN
                username = re.subn(r"([^\\]),", r"\1\,", username)[0]

Was turning the username my AD returned "Becotte, Paul" into "Becotte\, Paul", which fails auth. I am FAR from an AD expert and have no idea under what circumstances that escape may or may not be appropriate, but there was no combination of settings that would make my ldap auth bind with the search turned on. Fortunately, my setup appears to work fine with the search completely disabled (again, no idea if that is reliable or not!) but it feels like the escape_dn_username = False flag would also prevent the comma from being escaped?

(The latest version in this repo actually would have worked- I could have used attribute="uid", and a recent commit turns ['pbecotte'] into 'pbecotte' which would work, but there hasn't been a release since that change).

@Ownercz
Copy link

Ownercz commented Mar 24, 2020

Can confirm, after commenting out this part of the code, everything works.

@consideRatio
Copy link
Member

This was fixed by #267

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

Successfully merging a pull request may close this issue.

3 participants