这个问题我的解决办法是配置文件没有写对,下面是跑通后的配置

文件位置:/etc/gitlab/gitlab.rb

gitlab_rails['ldap_enabled'] = true

###! **remember to close this block with 'EOS' below**
 gitlab_rails['ldap_servers'] = YAML.load <<-'EOS'
   main: # 'main' is the GitLab 'provider ID' of this LDAP server
     label: 'AD 认证'
     host: '域控IP'
     port: 389
     uid: 'cn'
     bind_dn: 'CN=xxx,CN=xxx,DC=xxx,DC=xxx' #认证用户
     password: 'xxx' #认证密码
     encryption: 'plain' # "start_tls" or "simple_tls" or "plain"
     verify_certificates: true
#     smartcard_auth: false
     active_directory: true
     allow_username_or_email_login: true
#     lowercase_usernames: false
     block_auto_created_users: false
     base: 'OU=xxx,OU=xxx,DC=xxx,DC=xxx'
     user_filter: ''
 EOS

AD参数解释:

参数 说明 样例
管理员DN LDAP目录中存储管理员信息的条目名称。 CN=UserName, CN=Users, DC=test, DC=com
管理员密码 对应管理员DN配置的用户密码。 password:
用户组根DN 查询用户组时使用的Base DN OU=usergroup, DC=test, DC=com
用户根DN 查询用户时使用的Base DN DC=test, DC=com

参考链接:LDAP认证参数说明

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐