Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow responses to work with only an idp_cert_multi setting #402

Merged
merged 1 commit into from
Jul 4, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/onelogin/ruby-saml/logoutresponse.rb
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def valid_state?

return append_error("No issuer in settings of the logout response") if settings.issuer.nil?

if settings.idp_cert_fingerprint.nil? && settings.idp_cert.nil?
if settings.idp_cert_fingerprint.nil? && settings.idp_cert.nil? && settings.idp_cert_multi.nil?
return append_error("No fingerprint or certificate on settings of the logout response")
end

Expand Down
2 changes: 1 addition & 1 deletion lib/onelogin/ruby-saml/response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ def validate_response_state

return append_error("No settings on response") if settings.nil?

if settings.idp_cert_fingerprint.nil? && settings.idp_cert.nil?
if settings.idp_cert_fingerprint.nil? && settings.idp_cert.nil? && settings.idp_cert_multi.nil?
return append_error("No fingerprint or certificate on settings")
end

Expand Down
1 change: 1 addition & 0 deletions test/logoutresponse_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ class RubySamlTest < Minitest::Test
it "invalidate logout response when initiated with no idp cert or fingerprint" do
settings.idp_cert_fingerprint = nil
settings.idp_cert = nil
settings.idp_cert_multi = nil
logoutresponse = OneLogin::RubySaml::Logoutresponse.new(valid_logout_response_document, settings)
assert !logoutresponse.validate
assert_includes logoutresponse.errors, "No fingerprint or certificate on settings of the logout response"
Expand Down
1 change: 1 addition & 0 deletions test/response_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ class RubySamlTest < Minitest::Test
it "raise when No fingerprint or certificate on settings" do
settings.idp_cert_fingerprint = nil
settings.idp_cert = nil
settings.idp_cert_multi = nil
response.settings = settings
error_msg = "No fingerprint or certificate on settings"
assert_raises(OneLogin::RubySaml::ValidationError, error_msg) do
Expand Down