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

Hard-coded group_filter causing imcompatibility with certain LDAP configurations #133

Closed
ivan-gomes opened this issue Jul 24, 2019 · 1 comment · Fixed by #168
Closed

Comments

@ivan-gomes
Copy link

The filter used for checking allowed group membership is hard-coded, see

group_filter = (
'(|'
'(member={userdn})'
'(uniqueMember={userdn})'
'(memberUid={uid})'
')'
)

Some LDAP implementations/configurations do not allow queries that include attributes that don't exist, even when used in an or statement with other conditions that match.

For example, this works (returns >= 1 results):

(|(member=uid=ivangomes,ou=personnel,dc=dir,dc=ivangomes,dc=com)(uniqueMember=uid=ivangomes,ou=personnel,dc=dir,dc=ivangomes,dc=com))

but this doesn't (returns zero results):

(|(member=uid=ivangomes,ou=personnel,dc=dir,dc=ivangomes,dc=com)(uniqueMember=uid=ivangomes,ou=personnel,dc=dir,dc=ivangomes,dc=com)(memberUid=ivangomes))

because in this particular LDAP server, memberUid is not a recognized attribute.

While the current filter is a good catch-all default, we could work around this issue and other potential ones by exposing a command-line option to override group_filter, similarly to lookup_dn_search_filter.

In addition, some group implementations may require specifying search_base on the group search, which currently isn't possible, so this could be another configuration option to expose.

@kinow
Copy link
Contributor

kinow commented Jul 9, 2020

+1

This is related or duplicate of #62.

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