To Enable LDAP Accounts:
vi /etc/gitlab/gitlab.rb
gitlab_rails['ldap_enabled'] = true
gitlab_rails['ldap_servers'] = YAML.load <<-'EOS' # remember to close this block with 'EOS' below
main: # 'main' is the GitLab 'provider ID' of this LDAP server
label: 'saLAB'
host: 'gw.lab.sa'
port: 389
uid: 'uid'
method: 'plain' # "tls" or "ssl" or "plain"
bind_dn: 'cn=Manager,dc=lab,dc=sa'
password: 'S@123$%^Admin'
active_directory: false
allow_username_or_email_login: false
base: 'ou=People,dc=lab,dc=sa'
user_filter: '(objectClass=posixAccount)'
EOS
gitlab-ctl reconfigure
gitlab-rake gitlab:ldap:check
gitlab-ctl restart
* FAQ:
Error:
Could not authorize you from Ldapmain because "Undefined method 'provider' for nil:nilclass".
Cause:
No email attribute in ldap entry
Solution:
smbldap-usermod -M <email> <username> # To allow Gitlab