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
- Add an LDAP server to the GitLab configuration for your installation type. Set the directory host and
encryptionfor your deployment (simple_tlsfor LDAPS), keep certificate validation on, and inject the bind secret through the deployment’s secret handling. Set thebaseto the required directory subtree rather than the whole forest. - For Active Directory set
active_directoryand choose the login attribute (uidin GitLab’s configuration, commonly set tosAMAccountNamewith AD). Limit the eligible accounts withuser_filter; verify the filter in the actual directory, including how nested groups behave if you use them. - Apply the configuration and run the documented LDAP check,
sudo gitlab-rake gitlab:ldap:checkon 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.
