配置ldap域控,配置多个域控地址,登录页只显示第一个地址的label 请问还需要改哪里,才能让所有的登录标签显示出来
表条目
给你个示例参考下:
gitlab_rails['ldap_enabled'] = true
gitlab_rails['prevent_ldap_sign_in'] = false
gitlab_rails['ldap_servers'] = {
'main' => {
'label' => 'LDAP-TJ',
'host' => '127.0.0.1',
'port' => 389,
'uid' => 'uid',
'encryption' => 'plain',
'verify_certificates' => false,
'bind_dn' => 'cn=admin, dc=example, dc=cn',
'password' => 'admin',
'timeout' => 10,
'active_directory' => false,
'allow_username_or_email_login' => true,
'block_auto_created_users' => true,
'base' => 'dc=example,dc=cn',
'user_filter' => '(o!=true)',
'attributes' => {
'username' => ['uid', 'userid', 'sAMAccountName'],
'email' => ['mail', 'email', 'userPrincipalName'],
'name' => 'cn',
'first_name' => 'givenName',
'last_name' => 'sn'
},
'lowercase_usernames' => false,
# EE Only
'group_base' => 'dc=example,dc=cn',
'admin_group' => 'IT',
'external_groups' => [],
'sync_ssh_keys' => false
},
'secondary' => {
'label' => 'LDAP-BJ',
'host' => '127.0.0.1',
'port' => 389,
'uid' => 'uid',
'encryption' => 'plain',
'verify_certificates' => false,
'bind_dn' => 'cn=admin, dc=example, dc=cn',
'password' => 'admin',
'timeout' => 10,
'active_directory' => false,
'allow_username_or_email_login' => true,
'block_auto_created_users' => true,
'base' => 'dc=example,dc=cn',
'user_filter' => '(o!=true)',
'attributes' => {
'username' => ['uid', 'userid', 'sAMAccountName'],
'email' => ['mail', 'email', 'userPrincipalName'],
'name' => 'cn',
'first_name' => 'givenName',
'last_name' => 'sn'
},
'lowercase_usernames' => false,
# EE Only
'group_base' => 'dc=example,dc=cn',
'admin_group' => 'IT',
'external_groups' => [],
'sync_ssh_keys' => false
}
}
gitlab_rails[‘ldap_servers’] = YAML.load <<-‘EOS’
main: # ‘main’ is the GitLab ‘provider ID’ of this LDAP server
label: ‘江苏’
host: ‘xxxxx’
port: 389
uid: ‘SamaccountName’
bind_dn: ‘xxxxx’
password: ‘xxxxxx’
encryption: ‘plain’ # “start_tls” or “simple_tls” or “plain”
verify_certificates: true
active_directory: true
allow_username_or_email_login: true
lowercase_usernames: true
block_auto_created_users: false
base: ‘DC=test,DC=com’
user_filter: ‘’
## EE only
group_base: 'ou=Users,dc=test,dc=com'
admin_group: 'Administrators'
sync_ssh_keys: false
secondary: # ‘secondary’ is the GitLab ‘provider ID’ of second LDAP server
label: ‘上海’
host: ‘xxxxxxx’
port: 389
uid: ‘SamaccountName’
bind_dn: ‘xxxxx’
password: ‘xxxxx’
encryption: ‘plain’ # “start_tls” or “simple_tls” or “plain”
verify_certificates: true
active_directory: true
allow_username_or_email_login: true
lowercase_usernames: true
block_auto_created_users: false
base: ‘DC=test,DC=test,DC=com’
user_filter: ‘’
## EE only
group_base: 'dc=test,dc=test,dc=com'
admin_group: 'Administrators'
sync_ssh_keys: false
EOS
我设置的大概就是这样,但是无法把label全部显示出来,只会显示第一个地址的label,请问我配置的有问题吗,还是需要修改哪个参数?谢谢
你看下你配置文件/var/opt/gitlab/gitlab-rails/etc/gitlab.yml
里面的配置完整吗?
没有看出来 EOS 这种写法的配置分隔符在哪里?不像我示例的那种配置有{}分隔,你可以改成这种配置试下,Integrate LDAP with GitLab | GitLab
ldap:
enabled: true
sync_time:
prevent_ldap_sign_in: false
servers:
main: {“label”:“江苏”,“host”:“xxxxxx”,“port”:389,“uid”:“SamaccountName”,“bind_dn”:“xxxxxx”,“password”:“xxxxxx”,“encryption”:“plain”,“verify_certificates”:true,“active_directory”:true,“allow_username_or_email_login”:true,“lowercase_usernames”:true,“block_auto_created_users”:false,“base”:“DC=test,DC=com”,“user_filter”:"",“group_base”:“ou=Users,dc=test,dc=com”,“admin_group”:“Administrators”,“sync_ssh_keys”:false}
secondary: {“label”:“上海”,“host”:“xxxxxx”,“port”:389,“uid”:“SamaccountName”,“bind_dn”:“xxxxxx”,“password”:“xxxxxx”,“encryption”:“plain”,“verify_certificates”:true,“active_directory”:true,“allow_username_or_email_login”:true,“lowercase_usernames”:true,“block_auto_created_users”:false,“base”:“DC=test,DC=test,DC=com”,“user_filter”:"",“group_base”:“dc=test,dc=test,dc=com”,“admin_group”:“Administrators”,“sync_ssh_keys”:false}
yml上面是有这个的
那应该没有问题的,有尝试过清理下浏览器缓存吗?或者无痕模式浏览下
尝试过,没有效果
好的,非常谢谢!!!!