GitLab authentication with Active Directory (LDAP)

Set up GitLab Self-Managed LDAP login over TLS and check the bind account, user filter, account linking and access after offboarding.

Last updated

On this page (5)

GitLab · Active Directory / LDAP · LDAP

Before you start

GitLab Self-Managed supports LDAP authentication. LDAP group synchronization is a separate capability on Premium and Ultimate. Direct LDAP login is not federated SSO. Keep a non-LDAP recovery admin, a read-only bind account and a trust chain for the directory server.

Configure directory sign-in

  1. Add an LDAP server to the GitLab configuration for your installation type. Set the directory host and encryption for your deployment (simple_tls for LDAPS), keep certificate validation on, and inject the bind secret through the deployment’s secret handling. Set the base to the required directory subtree rather than the whole forest.
  2. For Active Directory set active_directory and choose the login attribute (uid in GitLab’s configuration, commonly set to sAMAccountName with AD). Limit the eligible accounts with user_filter; verify the filter in the actual directory, including how nested groups behave if you use them.
  3. Apply the configuration and run the documented LDAP check, sudo gitlab-rake gitlab:ldap:check on a Linux package deployment. Review GitLab’s rules for linking existing users, especially possible email matches, before anyone outside the pilot can sign in.

Verify the result

  • Test the same existing user’s projects before and after the change, then attempt sign-in with an out-of-scope account. If using a licensed group sync, confirm that a directory group grants only its intended GitLab group role.
  • Disable a pilot and test browser, SSH and token access on their own schedules. Do not treat successful LDAP login or a single disabled-browser test as proof that all prior access routes ended.

Official documentation

Have Pilae connect your identity provider

Pilae can deploy GitLab with your identity provider already connected. We agree the edition, account mapping and access tests with your team before rollout.