2015-10-19 28 views
0

我已經安裝了GitLab Omnibus Community Edition 8.0.2用於評估目的。我試圖將Gitlab(AWS上的Linux AMI)與運行在Win 2008 R2上的本地LDAP服務器連接起來。但是,我無法這樣做。我收到以下錯誤(無法從Ldapmain授權你,是因爲「無效憑證」):使用本地LDAP(Win 2008 R2)的Gitlab(AWS)認證

enter image description here

這裏就是我在gitlab.rb使用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: 'XX.YYY.Z.XX' 
    port: 389 
    uid: 'sAMAccountName' 
    method: 'plain' # "tls" or "ssl" or "plain" 
    bind_dn: 'CN=git lab,OU=users,OU=Service Accounts,OU=corp,OU=India,OU=Users,OU=UserId&Rooms,DC=india,DC=local' 
    password: 'pwd1234' 
    active_directory: true 
    allow_username_or_email_login: true 
    base: 'CN=git lab,OU=users,OU=Service Accounts,OU=corp,OU=India,OU=Users,OU=UserId&Rooms,DC=india,DC=local' 
    user_filter: '' 
EOS 

還有的配置兩個用戶:gitlab(新創建的AD用戶)和john.doe(舊AD用戶)

兩個用戶都能夠查詢所有AD用戶使用ldapsearch的命令,但是當我在gitlab.rb中使用它們各自的詳細信息(一次一個)並運行gitlab-rake gitlab:ldap:check命令時,它僅顯示有關該特定用戶的信息,而不是所有用戶。

此前,當我的憑證(john.doe)在gitlab.rb文件中配置時,gitlab-rake gitlab:ldap:check顯示AD的前100個結果。由於這是我的個人憑證,我要求我的IT團隊爲GitLab創建一個新的AD用戶(gitlab)。在我在gitlab.rb文件中配置新用戶(gitlab)並運行gitlab-rake gitlab:ldap:check後,它僅顯示該特定用戶的記錄。我認爲這可能是由於新創建的用戶有一些權限問題,所以我在gitlab.rb中恢復了我的個人憑據。令人驚訝的是,現在當我運行gitlab-rake gitlab:ldap:check時,我得到的只有一條記錄,而不是我之前得到的100條記錄。這真的很奇怪!我想,不知何故,GitLab會「忘記」以前的細節。

任何幫助將真正被讚賞。

回答

0

現在問題已解決。似乎它是我使用的版本(8.0.2)中的一個錯誤。將其升級到8.0.5修復了我的問題。

此外,爲我工作的bind_dn基地值:

bind_dn: 'CN=git lab,OU=users,OU=Service Accounts,OU=corp,OU=India,OU=Users,OU=UserId&Rooms,DC=india,DC=local' 

base: 'OU=users,OU=Service Accounts,OU=corp,OU=India,OU=Users,OU=UserId&Rooms,DC=india,DC=local'