这是我的配置
#####################开启ldap##################################
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: 'LDAP'
host: 'xxx'
port: 388
uid: 'uid'
method: 'plain' # "tls" or "ssl" or "plain"
bind_dn: 'cn=admin,dc=extension,dc=sopei'
password: 'xxx'
active_directory: false
allow_username_or_email_login: true
base: 'ou=people,dc=extension,dc=sopei'
user_filter: ''
attributes:
username: ['uid']
email: ['mail']
name: 'cn'
first_name: 'givenName'
last_name: 'sn'
## EE only
# group_base: ''
# admin_group: ''
# sync_ssh_keys: false
# secondary: # 'secondary' is the GitLab 'provider ID' of second LDAP server
# label: 'LDAP'
# host: '_your_ldap_server'
# port: 389
# uid: 'sAMAccountName'
# method: 'plain' # "tls" or "ssl" or "plain"
# bind_dn: '_the_full_dn_of_the_user_you_will_bind_with'
# password: '_the_password_of_the_bind_user'
# active_directory: true
# allow_username_or_email_login: false
# base: ''
# user_filter: ''
# ## EE only
# group_base: ''
# admin_group: ''
# sync_ssh_keys: false
EOS
#####################开启ldap##################################
重新加载gitlab-ctl reconfigure后,通过check指令查到的response也是ok的
[root@VM_247_180_centos ~]# gitlab-rake gitlab:ldap:check
Checking LDAP ...
Server: ldapmain
LDAP authentication... Success
LDAP users with access to your GitLab server (only showing the first 100 results)
......