ruby-on-rails - 无需服务器端访问的 Gitlab LDAP(Active Directory)身份验证

标签 ruby-on-rails active-directory ldap gitlab

我在 RHEL 6.6 上使用 GitLab Omnibus 7.10.0。我已使用以下配置启用 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: 'FOO COM Active Directory (LDAP)'
 host: 'ad.server.foo.com'
 port: 3268
  uid: 'someuser'
 method: 'plain' # "tls" or "ssl" or "plain"
 bind_dn: 'CN=My Whole. Name,OU=Some Users,DC=ad,DC=server,DC=foo,DC=com'
 password: 'thepassword'
 active_directory: true
 allow_username_or_email_login: false
 block_auto_created_users: false
 base: 'DC=ad,DC=server,DC=foo,DC=com'
 user_filter: ''
#     ## EE only
#     group_base: ''
#     admin_group: ''
#     sync_ssh_keys: false
#
#   secondary: # NOT FILLED OUT
EOS

我的问题是我无法让用户通过 LDAP 进行身份验证。我不确定配置是否错误,或者我需要在服务器端执行某些操作(我无法直接访问)。当我运行时

gitlab-rake gitlab:ldap:check RAILS_ENV=production

我明白了

Checking LDAP ...

LDAP users with access to your GitLab server (only showing the first 100 results)
Server: ldapmain 

Checking LDAP ... Finished

我可以通过此帐户(我的个人帐户)或其他应用程序的其他帐户来搜索使用 java 的个人用户,但无法让 AD 与 gitlab 一起使用。我通过在 Windows 机器上运行此命令获得了 bind_dn“My Whole.Name”。 gpresult-r

我还尝试了以下的bind_dn:

uid=myADaccountname,OU=Some Users,DC=ad,DC=server,DC=foo,DC=com
and 
<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="3a57437b7e5b5959554f544e545b575f7a5b5e14495f484c5f48145c555514595557" rel="noreferrer noopener nofollow">[email protected]</a>

但我仍然遇到同样的问题。

最佳答案

对于 Active Directory,uid 应为:

uid: 'sAMAccountName'

Gitlab 应使用 bind_dn 中指定的用户以及给定的密码进行连接。

关于ruby-on-rails - 无需服务器端访问的 Gitlab LDAP(Active Directory)身份验证,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30789413/

相关文章:

ruby-on-rails - 哪种数据模型最适合用户 View 的简单跟踪器?

ruby-on-rails-3 - 集成 ActiveAdmin 和 adauth

c# - 有没有办法通过 UserPrincipal 类设置新用户的域后缀?

authentication - ldapsearch : Invalid credentials

ruby-on-rails - Rails Devise Ajax 调用

javascript - 重复的 POST 方法,为什么?

ruby-on-rails - 在没有 '<%= %>' 或 ruby​​ on rails 的 erb 中打印

c# - 奇怪的 COM 互操作异常 0x80005000 使用 System.DirectoryServices.AccountManagement 库

java - 在本地 Solaris 系统上验证 LDAP 登录凭据的简单方法是什么

javax.命名.InvalidNameException : [LDAP: error code 34 - invalid DN]