我想用gitlab配置LDAP認證。我的配置是成才這樣的:如何調試Gitlab LDAP身份驗證?
ldap:
enabled: true
host: 'ldap.example.com'
base: 'ou=People,o=example.com'
port: 636
uid: 'uid'
method: 'ssl' # "ssl" or "plain"
bind_dn: 'cn=gitlab,ou=Apps,o=example.com'
password: 'password'
allow_username_or_email_login: true
我用下面的測試吧:
ldapsearch -b "ou=People,o=example.com" -s sub -D "cn=gitlab,ou=Apps,o=example.com" -H ldaps://ldap.example.com:636 -w "password" -x "([email protected])"
上述工程的線,但是當我嘗試登錄使用LDAP,我總是得到「無效憑證」。
如何解決這個問題並縮小問題的根本原因?
編輯26/09:
這裏有一些事情我就production.log發現:
Started GET "https://stackoverflow.com/users/sign_in" for 127.0.0.1 at 2013-09-23 17:42:58 -0300
Processing by Devise::SessionsController#new as HTML
Rendered devise/sessions/_new_ldap.html.haml (1.7ms)
Rendered devise/sessions/_new_base.html.haml (1.8ms)
Rendered devise/sessions/_oauth_providers.html.haml (0.0ms)
Rendered devise/sessions/new.html.haml within layouts/devise (4.2ms)
Rendered layouts/_head.html.haml (1.6ms)
Rendered layouts/_flash.html.haml (0.1ms)
Completed 200 OK in 9ms (Views: 6.9ms | ActiveRecord: 0.0ms)
Started POST "https://stackoverflow.com/users/auth/ldap/callback" for 127.0.0.1 at 2013-09-23 17:43:00 -0300
Processing by OmniauthCallbacksController#failure as HTML
Parameters: {"utf8"=>"â", "authenticity_token"=>"AwqZsVHRqOeZr+GLWWeGM7MyOAdk7cFl8/rZgbVRU+8=", "username"=>"[email protected]", "password"=>"[FILTERED]"}
Redirected to http://example.com/users/sign_in
Completed 302 Found in 3ms (ActiveRecord: 0.0ms)
Started GET "https://stackoverflow.com/users/sign_in" for 127.0.0.1 at 2013-09-23 17:43:00 -0300
Processing by Devise::SessionsController#new as HTML
Rendered devise/sessions/_new_base.html.haml (2.8ms)
Rendered devise/sessions/_oauth_providers.html.haml (0.1ms)
Rendered devise/sessions/new.html.haml within layouts/devise (3.7ms)
Rendered layouts/_head.html.haml (1.7ms)
Rendered layouts/_flash.html.haml (0.1ms)
Completed 200 OK in 9ms (Views: 6.6ms | ActiveRecord: 0.0ms)
Started GET "/" for 127.0.0.1 at 2013-09-23 18:50:08 -0300
Processing by DashboardController#show as HTML
Completed 401 Unauthorized in 1ms
編輯:我終於得到了答案:在設計一個配置被剝離後的everyting「@ 」。我不記得確切的名字,但我可以儘快發佈到機器上。我通過向ldap oauth登錄添加日誌來發現此問題。
從提供服務器的訪問日誌開始。該日誌包含每個操作請求和結果的記錄以及BIND的詳細信息,但密碼除外。 –
我發現的唯一日誌來自nginx,gitlab_access.log。有沒有那麼多有用的信息(一些請求/響應,沒有綁定的細節) –
客戶端使用哪個LDAP服務器? –