2016-07-28 38 views
2

我試圖將gitlab配置爲openldap來驗證用戶身份。我配置了openldap,並且它與Jenkins正常工作。但隨着gitlab它給了錯誤Could not authenticate you from Ldapmain because "Invalid credentials".使用開放式LDAP配置GitLab

下面是gitlab.rb CONFIGS:

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: 'localhost' 
    port: 389 
    uid: 'uid' 
    method: 'plain' # "tls" or "ssl" or "plain" 
    bind_dn: 'cn=admin,dc=ldap,dc=com' 
    password: 'waqas' 
    active_directory: false 
    allow_username_or_email_login: true 
    #block_auto_created_users: false 
    base: 'cn=Appliance,dc=ldap,dc=com' 
    user_filter: '' 
# attributes: 
# username: ['uid', 'userid', 'sAMAccountName'] 
# email: ['mail', 'email', 'userPrincipalName'] 
# name:  'cn' 
#  first_name: 'givenName' 
#  last_name: 'sn' 
#  ## EE only 
# group_base: 'ou=W-Integrate,dc=ldap,dc=com' 
    #admin_group: 'cn=admin,dc=ldap,dc=com' 
#  sync_ssh_keys: false 
# 

EOS 

enter image description here 和我的OpenLDAP的畫面拍攝也連接。任何人都可以糾正我做錯了什麼。

+0

它只是通過修改基地DN的工作? – VonC

+0

是的,它就像一個魅力..感謝 –

+0

\ o /,或者更確切地說:9(。•‿•。)6 – VonC

回答

2

你的鹼不應該是一個用戶(或inetOrgPerson,用戶cn=Appliance的基團),它應限於dc entriesa base dn

base: 'dc=ldap,dc=com' 

這從bind_dn,結合帳戶,該帳戶不參考一個不同用戶:bind_dn: 'cn=admin,dc=ldap,dc=com':那裏有一個cn