2017-06-06 54 views
8

我嘗試使用OpenProject OmniAuth SAML Single-Sign On插件設置與OpenProject的SSO(單點登錄)集成。我已經配置了相關的細節。生成元數據並將其註冊到由Shibboleth提供支持的IDP。該插件在openproject登錄表單上顯示了一個額外的登錄按鈕。點擊它正確重定向到IDP的登錄頁面。在提供憑據後,它正確地重定向到我提到的AssertionConsumerService URL。它的形式是https://example.com/openproject/auth/saml/callback。但該頁面顯示錯誤的請求錯誤。調試文件app/controllers/concerns/omniauth_login.rb表明,在omniauth_login函數中,以下代碼行導致400錯誤。OpenProject OmniAuth SAML單點登錄集成

auth_hash = request.env['omniauth.auth'] 

return render_400 unless auth_hash.valid? 

auth_hash的值看起來爲空。這可能是由於屬性映射或其他原因造成的問題嗎?我來自PHP bacnkground,並沒有紅寶石的經驗。所以很難調試這個問題。我試了很多google搜索,但找不到任何有用的東西。

任何幫助,非常感謝。

由於

回答

1

用下面的代碼

uid do 
     if options.uid_attribute 
      ret = find_attribute_by([options.uid_attribute]) 
      if ret.nil? 
      raise OmniAuth::Strategies::SAML::ValidationError.new("SAML response missing '#{options.uid_attribute}' attribute") 
      end 
      ret 
     else 
      @name_id 
     end 
     end 

策略內部/ saml.rb

將以下代碼

uid { @name_id } 

文件。它是def other_phase功能

僅供參考,請裏面有一個查看以下鏈接GitHub的 https://github.com/omniauth/omniauth-saml/blob/master/lib/omniauth/strategies/saml.rb行數90