Gitlab Integration with LDAP user_filter

2k views Asked by At

I have integrated my Gitlab with my ldap active directory and able to successfully login. But I want to filter the users to allow only some specific users to login to Gitlab because my active directory contains all my company's users so don't want them to access the Gitlab instance.

While reading this documentation https://docs.gitlab.com/ee/////////administration/auth/ldap/index.html I came across this attribute user_filter where we can restrict the users but I don't know how do i use it.

Right now it's value is this - 'user_filter' => '(&(objectCategory=Person)(AccountName=*))'. How do i put some specific users here so that only they will be able to access it or is it not possible?

Let me know if someone can advice here.

1

There are 1 answers

0
link89 On BEST ANSWER

Try this

'user_filter' => '(&(objectCategory=Person)(|(AccountName=Alice)(AccountName=Bob)(AccountName=Clare)))'

The value of user_filter is LDAP filter. You can learn more about it from this doc.