我试图使用OpenProject插件来设置SSO(单点登录)与OpenProject OmniAuth SAML单点登录的集成。我已经配置了相关的细节。生成元数据并将其注册到由Shibboleth提供动力的IDP中。插件确实在openproject登录表单上显示了一个额外的登录按钮。单击它可以正确地重定向到IDP的登录页面。在提供凭据之后,它将正确地重定向到我提到的AssertionConsumerService URL。它是https://example.com/openproject/auth/saml/callback格式的。但是页面显示了一个错误的请求。对文件app/controllers/concerns/omniauth_login.rb进行调试表明,在omniauth_login函数中,下面的代码行将导致400错误。
auth_hash = request.env['omniauth.auth']
return render_400 unless auth_hash.valid?auth_hash的值看起来是空的。这可能是由于属性映射或其他原因引起的问题吗?我来自PHP基地,对ruby on rails没有经验。所以很难调试这个问题。我已经尝试谷歌了很多,但找不到任何有用的东西。
任何帮助都是非常感谢的。
谢谢
发布于 2017-09-14 13:39:50
替换以下代码
uid { @name_id }使用以下代码
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
文件。它在def other_phase函数中
如需参考,请查看以下github链接https://github.com/omniauth/omniauth-saml/blob/master/lib/omniauth/strategies/saml.rb线路编号90
https://stackoverflow.com/questions/44387564
复制相似问题