首页 > gitlab 无法使用ldap登陆

gitlab 无法使用ldap登陆

输入ldap的密码后报错:

我的问题:

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)

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

【热门文章】
【热门文章】