LDAP User Filter, DN special characters

Hello,

I’m using gitlab ce version 11.7.5 and I’m trying to use user_filter in my gitlab configuration but I got an OU in my group DN with parenthesis.

I tried this query with ldapsearch and it returns me what I expect:
(&(objectClass=user)(memberof=CN=Gitlab.Group,OU=Security,OU=Groups,OU=ou with space \(and parenthesis\),DC=eu,DC=domain,DC=com))

With ldapsearch I can easily escape the parenthesis with \

  • If I reconfigure my conf with this query, I can’t access to my gitlab webpage, it display error 502.
  • If I reconfigure my conf with this query without escape parenthesis, it display error 502.
  • If I change the user_filter with a name without parenthesis, it just work fine and I can connect with a user in this group.

Here the part of my configuration related to ldap:
gitlab_rails[‘ldap_enabled’] = true
gitlab_rails[‘ldap_servers’] = YAML.load <<-EOS
main:
label: ‘LDAP’
host: ‘DCName.eu.domain.com
port: 389
uid: ‘sAMAccountName’
method: ‘plain’
bind_dn: ‘service.account’
password: ‘password’
active_directory: true
allow_username_or_email_login: ‘False’
base: ‘DC=domain,DC=eu,DC=com’
user_filter: ‘(&(objectClass=user)(memberof=CN=Gitlab.Group,OU=Security,OU=Groups,OU=ou with space (and parenthesis),DC=eu,DC=domain,DC=com))’
EOS

I would appreciate any help to find the correct syntax for my user_filter.
Thanks a lot.

I have the same problem. have you find any solution for it?
Thanks