【问题标题】:LDAP Configuration not working on Gitlab CE 8.12LDAP 配置在 Gitlab CE 8.12 上不起作用
【发布时间】:2017-07-26 01:35:51
【问题描述】:

我们正在尝试将我们的本地 Gitlab CE 安装(omnibus,版本 8.12)与我们的 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: 'LDAP'
  host: '******.******.***'
  port: 389
  uid: 'sAMAccountName'
  method: 'plain' # "tls" or "ssl" or "plain"

  bind_dn: 'uid=******,ou=******,o=Applications,o=******,c=******'
  password: '**********'

  timeout: 10

  active_directory: true

  allow_username_or_email_login: false

  block_auto_created_users: false

  base: 'o=******'

  user_filter: ''

  attributes:
    username: ['uid', 'userid', 'sAMAccountName']
    email:    ['mailExterno', 'mail', 'email', 'userPrincipalName']

    name:       'cn'
    first_name: 'givenName'
    last_name:  'sn'

  ## EE only

  group_base: ''

  admin_group: ''

  sync_ssh_keys: false

EOS

执行 LDAP 检查显示零用户:

[root@myserver mydir]# gitlab-rake gitlab:ldap:check
Checking LDAP ...

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

Checking LDAP ... Finished

我们的 LDAP 服务器中有数十个用户,并且许多应用程序(例如 Redmine、Jenkins、Svn ......)都毫无问题地与之集成......

关于我们在 Gitlab 上做错了什么有什么想法吗?

非常感谢您的帮助。

【问题讨论】:

  • 当我开始使用 Gitlab 时,我在设置 LDAP 时遇到了类似的问题。可能与配置bind_dnbase 有关。尝试一些不同的组合,直到找到合适的组合。您的配置中似乎没有 CN 或 DC,这可能是原因。
  • 太添加到@alejdg,你应该为这两个属性使用一个可分辨的名称。如果您使用 sAMAccountName 进行身份验证,请将 allow_username_or_email_login 设置为 true。
  • 感谢您的 cmets。最后,我们找到了解决方案。我已将其作为答案发布在下面,以防其他人发现它有用。

标签: ldap gitlab gitlab-omnibus


【解决方案1】:

我们终于找到了解决方案。我在这里发布答案,以防万一其他人阅读本文并面临类似问题可能会发现它有用。

我连接的 LDAP 服务器不是 Active Directory,所以我需要在哪里进行配置更改:

  #...

  uid: 'uid'

  #...

  active_directory: false

  #...

需要考虑的一个非常重要的方面是,为了应用更改,重启 gitlab 是不够的,我们应该执行重新配置

sudo gitlab-ctl reconfigure

【讨论】:

    猜你喜欢
    • 2015-04-10
    • 1970-01-01
    • 2017-04-20
    • 1970-01-01
    • 2020-05-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-11-26
    相关资源
    最近更新 更多