GitLab&OpenLDAP:无效凭证

我有两台CentOS 7.0的机器。 第一个是只有OpenLDAP的域控制器。 我根据本教程configuration了OpenLDAP: http : //www.server-world.info/en/note? os=CentOS_7&p=openldap

然后,我有另一台机器与GitLab。 我正在尝试configurationLDAP身份validation,但每次收到“无效凭据”错误。

我的GitLabconfiguration:

gitlab-rails": { "ldap_enabled": true, "ldap_servers": { "main": { "label": "LDAP", "host": "192.168.50.4", "port": 389, "uid": "uid", "method": "plain", "bind_dn": "CN=gitlab,OU=people,DC=courseproject,DC=org", "password": "mypass", "active_directory": false, "allow_username_or_email_login": false, "base": "OU=people,DC=courseproject,DC=org", "user_filter": "" } 

我必须使用普通身份validation和LDAP,而不是LDAPS的另一个项目。

我的用户和群组configuration:

 dn: dc=courseproject,dc=org objectClass: top objectClass: dcObject objectclass: organization o: courseproject org dc: courseproject dn: cn=admin,dc=courseproject,dc=org objectClass: simpleSecurityObject objectClass: organizationalRole cn: admin userPassword: mySHApass dn: ou=people,dc=courseproject,dc=org objectClass: organizationalUnit ou: people dn: ou=groups,dc=courseproject,dc=org objectClass: organizationalUnit ou: groups 

我对OpenLDAP并不熟悉,以前只有AD的经验。

我可以提供哪些信息来调查这个问题?

首先,您可能allow_username_or_email_login的configurationallow_username_or_email_logintrue

那么你可能想要创build一个组用户持有你希望授予访问服务器的用户,并修改user_filter'(memberOf=cn=gitlabusers,ou=groups,dc=courseproject,dc=org)'

然后使用gitlab-ctl reconfigure应用更改,并使用检查LDAPconfiguration

  gitlab-rake gitlab:ldap:check RAILS_ENV=production 

除非这个命令成功地给你所期望的用户列表,否则你的configuration有错误。

有关信息,我的下面的configuration(对FreeIPA服务器)工作:

  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: 'IPA' host: 'ipa.mydomain.com' port: 389 uid: 'uid' method: 'tls' # "tls" or "ssl" or "plain" bind_dn: 'uid=gitlab,cn=sysaccounts,cn=etc,dc=mydomain,dc=com' password: '<password>' active_directory: false allow_username_or_email_login: true #block_auto_created_users: false base: 'cn=users,cn=accounts,dc=mydomain,dc=com' user_filter: '(memberOf=cn=gitlabusers,cn=groups,cn=accounts,dc=mydomain,dc=com)' ## EE only group_base: 'cn=groups,cn=accounts,dc=mydomain,dc=com' #admin_group: '' #sync_ssh_keys: true EOS