GitLab Active Directory authentication: no results and no authentication

Solution 1:

I was able to solve this after many different tries. A few notes:

  • Make sure that all the lines except the first have a single space for indent. The first line is the one that says "main:" and that has no indent at all.
  • The bind_dn is not the full LDAP path for the bind user, but just the username. In my case it's "[email protected]".
  • The base needs to be the Active Directory group or DN or whatever it's called that contains all the users.

Here's the final YAML:

main: # 'main' is the GitLab 'provider ID' of this LDAP server
 label: 'Active Directory'
 host: 'ad-server.example.com'
 port: 389
 uid: 'sAMAccountName'
 method: 'plain' # "tls" or "ssl" or "plain"
 bind_dn: '[email protected]'
 password: 'password'
 active_directory: true
 allow_username_or_email_login: false
 block_auto_created_users: false
 base: 'OU=ABC,OU=XYZ,DC=example,DC=com'
 user_filter: ''