-
Notifications
You must be signed in to change notification settings - Fork 55
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
LDAP filter not escaped properly #34
Comments
Actually, nevermind, I have no idea what's going on, some users can sign in, some can't. |
Gee, that's one way to "solve" issues I guess. |
I took this as it was an issue on your end. Is this still an issue for you? I can re-open it. |
It still is an issue. We ended up removing the filter coz it's useless at this point. I'm not a big fan of it since it lets anyone sign in. |
RequirementUsers can be member of
The LDAP filter used in other applications looks like this:
ProblemI'm seeing the same behaviour as described above.
AnalysisI don't know anything about omniauth nor how exactly it works within Ruby and the LDAP strategy. Fortunately everything is open source, so I did a little reading there. I fear to patch the Discourse container for better debugging, so I just tried to gather an idea how this LDAP filter is constructed and passed to omniauth. Plugin to omniauthplugin.rb maps the field from Discourse settings 1:1 to omniauth-ldap.
Therefore I can talk directly to omniauth via admin settings, that's good to know. Documentation hintThe omniauth-ldap documentation says that you can use the filter parameter to also directly filter for the
SolutionA working filterIn addition to the main check, e.g. the objectclass, combine it with
PatchEither the documentation needs a hint for a "special" LDAP filter format, or the plugin takes care of constructing the filter itself. Maybe it needs to parse the settings then, I'm not sure about this. Maybe it can just prepend the string with
I did not test the above code though. |
Seeing the exact same behavior. Any help is greatly appreciated |
Did you try the workaround filter mentioned in #34 (comment) ? |
I actually solved my problem by comparing the working/non-working user attributes and since I am using email to logon, some did not have the attribute "mail" setup. Once I corrected that, all the users that weren't able to logon are now successfully logging in. |
Take the following DN as an example:
This results in the following error on the UI:
And in the error logs:
Workaround: put
\20
in place of spaces.This might be required for other fields as well, haven't tested it extensively.
The text was updated successfully, but these errors were encountered: