TransWikia.com

Empty user list in Gitlab LDAP connection

Server Fault Asked on November 20, 2021

I am trying to connect Gitlab to our Active Directory. I have a connection to LDAP, where the authorization succeeds but the list of users with access to Gitlab is empty.

The gitlab config looks like this:

gitlab_rails['ldap_servers'] = YAML.load <<-'EOS'
  main: # 'main' is the GitLab 'provider ID' of this LDAP server#
    label: 'MyDomain'
    host: '192.168.62.5'
    port: 389
    uid: 'administrator'
    bind_dn: 'administrator@my_domain.local'
    password: 'real_password'
    encryption: 'plain' # "start_tls" or "simple_tls" or "plain"
    verify_certificates: true
    smartcard_auth: false
    active_directory: true
    allow_username_or_email_login: true
    lowercase_usernames: false
    block_auto_created_users: false
    base: 'OU=Benutzer,OU=DOMAIN,dc=my_domain,dc=local'
    user_filter: ''
    attributes:
      username: ['uid', 'userid', 'sAMAccountName']
      email: ['mail', 'email', 'userPrincipalName']
      name: 'cn'
      first_name: 'givenName'
      last_name: 'sn'
EOS

When I run gitlab-rake check:ldap:gitlab this is the result:

enter image description here

As you can see there are no users returned. I have also tried different user filters but it will always result in the error Invalid filter syntax. When I remove the user_filter property completely the user list is also empty.

The base_dn contains all users of the domain and I am using Active Directory with Windows Server 2008 R2.

What am I missing?

One Answer

The uid attributes defines the ldap attribute which is used as uid in gitlab. I'm using the sAMAccountName for this. So i can login with my windows user.

Answered by Alexander Worlitschek on November 20, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP