Gitlab Ldap身份验证设置

时间:2014-07-30 21:08:39

标签: authentication ldap gitlab

当前环境:

  • Gitlab服务器: Centos 6.5
  • Active Directory: Windows Server 2008 R2

任何人都可以在Gitlab 7.1.1中检查Ldap身份验证的这些虚构设置吗?

gitlab_rails['ldap_enabled'] = true
gitlab_rails['ldap_host'] = 'myserver.dom.com.net'
gitlab_rails['ldap_port'] = 389
gitlab_rails['ldap_uid'] = 'sAMAccountName'
gitlab_rails['ldap_method'] = 'plain' # 'ssl' or 'plain'
gitlab_rails['ldap_bind_dn'] = 'OU=Users,DC=dom,DC=com,DC=net'
gitlab_rails['ldap_password'] = '????'
gitlab_rails['ldap_allow_username_or_email_login'] = true
gitlab_rails['ldap_base'] = 'DC=dom,DC=com,DC=net'

必须设置 ldap_bind_dn 以便Gitlab工作(用户帐户等效)?

为了让Gitlab工作,必须设置哪个 ldap_password

我遵循了以下建议:@metaDiego和@heinglandreas。两者都在正确的道路上。所以我在行中修改了我的设置:

解决方案

gitlab_rails['ldap_bind_dn'] = 'CN=the_allowed_user_for_access_ldap,OU=Users,DC=dom,DC=com,DC=net'
gitlab_rails['ldap_password'] = 'the_password_of_allowed_user'

ldap_bind_dn 可能会因AD结构和允许用户所在的当前级别而异。

我的公司AD不允许匿名Ldap查询。因此,必须添加这些参数。

在域管理员中搜索帮助,以获取这些参数。

来自Github的gitlabhq的有用文章

如果gitlab_rails['ldap_allow_username_or_email_login'] = true,登录用户可以使用电子邮件格式,也可以只使用域用户。

Gitlab authentication form

2 个答案:

答案 0 :(得分:4)

ldap_bind_dn必须是具有对LDAP的读取权限的用户的DN。据我所知,你指向一个OU=Users,DC=dom,DC=com,DC=net的目录结构。您必须将该用户密码用作“`

所以ldap_bind_dn应该读取uid=userid,OU=Users,DC=com,DC=com,DC=net之类的内容,然后ldap_password应为userid密码。

在某些LDAP服务器上ldap_bind_dn可以保留为空,因为它们允许匿名绑定。在这种情况下,ldap_password也必须留空。

这有意义吗?否则随便发表评论!

答案 1 :(得分:3)

我有一个有效的GitLab LDAP配置文件,password字段必须与您选择的bind_dn用户匹配。

gitlab_rails['ldap_base'] = 'ou=somehting,dc=foo,dc=bar'
gitlab_rails['ldap_bind_dn'] = 'uid=SOMEONE,ou=somehting,dc=foo,dc=bar'
gitlab_rails['ldap_password'] = 'SOMEONE_PASSWORD'
  • ldap_base是您搜索用户的地方

  • ldap_bind_dn是"外部LDAP服务器上的用户允许在定义的搜索库中搜索LDAP目录。"

  • ldap_passwordbind_dn用户的密码。因此,在您的情况下,它必须与用户OU=Users的密码匹配。

相关问题