gitlab 无法使用ldap登陆

发布于 2022-09-01 15:43:38 字数 3708 浏览 26 评论 0

输入ldap的密码后报错:

image

我的问题:

  • 有人遇到过这个问题么?如何解决呢?
  • gitlab给的log(/var/log/gitlab/gitlab-rails/production.log)太简单了,如何修改log的level看到是哪里出现bug到时这个问题呢?

    /etc/gitlab/gitlab.rb

rubygitlab_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: '127.0.0.1'
    port: 389
    uid: 'cn'
    method: 'plain' # "tls" or "ssl" or "plain"
    bind_dn:  ''
    password: 'admin'
    active_directory: false
    allow_username_or_email_login: false
    block_auto_created_users: false
    base: 'dc=mydomain,dc=net'
    user_filter: '(objectClass=*)'
    ## EE only
    group_base: ''
    admin_group: ''
    sync_ssh_keys: false
EOS

openldap config:

database        bdb
suffix          "dc=mydomain,dc=net"
rootdn          "cn=Manager,dc=mydomain,dc=net"

rootpw  admin

directory       /usr/local/openldap/var/openldap-data

index   objectClass     eq

用户登陆时LDAP的log:

55b1f215 @(#) $OpenLDAP: slapd 2.4.41 (Jul 23 2015 12:08:48) $
    root@iZ25r9re2foZ:/root/openldap-2.4.41/servers/slapd
55b1f215 bdb_monitor_db_open: monitoring disabled; configure monitor database to enable
55b1f215 slapd starting
55b1f21d conn=1000 fd=12 ACCEPT from IP=192.168.1.159:2406 (IP=0.0.0.0:389)
55b1f21d conn=1000 op=0 BIND dn="" method=128
55b1f21d connection_input: conn=1000 deferring operation: binding
55b1f21d conn=1000 op=0 RESULT tag=97 err=49 text=
55b1f21d conn=1000 op=1 SRCH base="" scope=0 deref=0 filter="(objectClass=*)"
55b1f21d conn=1000 op=1 SRCH attr=altServer namingContexts supportedCapabilities supportedControl supportedExtension supportedFeatures supportedLdapVersion supportedSASLMechanisms
55b1f21d conn=1000 op=1 SEARCH RESULT tag=101 err=0 nentries=1 text=
55b1f21d conn=1000 op=2 SRCH base="dc=mydomain,dc=net" scope=2 deref=0 filter="(cn=jiayanni)"
55b1f21d <= bdb_equality_candidates: (cn) not indexed
55b1f21d conn=1000 op=3 BIND dn="cn=jiayanni,dc=mydomain,dc=net" method=128
55b1f21d conn=1000 op=3 BIND dn="cn=jiayanni,dc=mydomain,dc=net" mech=SIMPLE ssf=0
55b1f21d conn=1000 op=2 SEARCH RESULT tag=101 err=0 nentries=1 text=
55b1f21d conn=1000 op=3 RESULT tag=97 err=0 text=
55b1f21d conn=1000 fd=12 closed (connection lost)

用户登陆时gitlab的log:/var/log/gitlab/gitlab-rails/production.log

Started GET "/users/sign_in" for 192.168.1.92 at 2015-07-24 15:48:38 +0800
Processing by SessionsController#new as HTML
Completed 200 OK in 21ms (Views: 7.8ms | ActiveRecord: 2.1ms)
Started POST "/users/auth/ldapmain/callback" for 192.168.1.92 at 2015-07-24 16:06:53 +0800
Processing by OmniauthCallbacksController#ldapmain as HTML
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"[FILTERED]", "username"=>"jiayanni", "password"=>"[FILTERED]"}
Completed 500 Internal Server Error in 25ms (ActiveRecord: 3.0ms)
Processing by OmniauthCallbacksController#failure as HTML
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"[FILTERED]", "username"=>"jiayanni", "password"=>"[FILTERED]"}
Redirected to http://192.168.1.159/users/sign_in
Completed 302 Found in 8ms (ActiveRecord: 0.2ms)
Started GET "/users/sign_in" for 192.168.1.92 at 2015-07-24 16:06:53 +0800
Processing by SessionsController#new as HTML
Completed 200 OK in 21ms (Views: 8.3ms | ActiveRecord: 2.0ms)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

静水深流 2022-09-08 15:43:38

我也遇到此类问题,不知道楼主解决没?

征棹 2022-09-08 15:43:38

怎么解决的啊?我也遇到了这个问题。当我执行 sudo gitlab-rake gitlab:ldap:check 检查成功并且得到了用户的信息,但当我在浏览器直接访问登录报500

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文