-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[improvements] Return error to application and support SLO request va…
…lidation (#224) * Squash commits for saml_idp gem * [feat] Allow SP config force signature validation (#16) * Allow SP config force signature validation * Allow SP config force signature validation Tested with Slack with Authn request signature option --------- Co-authored-by: zogoo <[email protected]> * [feat] Don’t ignore certificates without usage (#17) I have tested with live SAML SP apps and it works fine * Unspecified certifciate from SP metadata --------- Co-authored-by: zogoo <[email protected]> * wip add error collector * Fix type and rewrite request with proper validation test cases * Try with proper way to update helper method (#19) * Set minimum test coverage (#207) * Set minimum test coverage to a very high value for testing * Update minimum coverage to actual current value * Try with proper way to update helper method * Correctly decode and mock with correct REXML class * Drop the min coverage --------- Co-authored-by: Mathieu Jobin <[email protected]> Co-authored-by: zogoo <[email protected]> * Lead error render decision to gem user * Validate the certificate's existence before verifying the signature. * [feat] Collect request validation errors (#18) * wip add error collector * Fix type and rewrite request with proper validation test cases * Lead error render decision to gem user * Validate the certificate's existence before verifying the signature. --------- Co-authored-by: zogoo <[email protected]> * Support lowercase percent-encoded sequences for URL encoding (#20) Co-authored-by: zogoo <[email protected]> * Remove duplications * Pre-conditions need to be defined in before section * Le's not test logger in here * Let's not break anything for now * Rename correctly --------- Co-authored-by: zogoo <[email protected]> Co-authored-by: Mathieu Jobin <[email protected]>
- Loading branch information
1 parent
12416c4
commit 4b7e4c8
Showing
10 changed files
with
344 additions
and
192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,16 +81,6 @@ def params | |
expect(response.is_valid?).to be_truthy | ||
end | ||
|
||
it "should create a SAML Logout Response" do | ||
params[:SAMLRequest] = make_saml_logout_request | ||
expect(validate_saml_request).to eq(true) | ||
expect(saml_request.logout_request?).to eq true | ||
saml_response = encode_response(principal) | ||
response = OneLogin::RubySaml::Logoutresponse.new(saml_response, saml_settings) | ||
expect(response.validate).to eq(true) | ||
expect(response.issuer).to eq("http://example.com") | ||
end | ||
|
||
it "should by default create a SAML Response with a signed assertion" do | ||
saml_response = encode_response(principal) | ||
response = OneLogin::RubySaml::Response.new(saml_response) | ||
|
@@ -128,7 +118,7 @@ def params | |
context "Single Logout Request" do | ||
before do | ||
idp_configure("https://foo.example.com/saml/consume", true) | ||
slo_request = make_saml_sp_slo_request | ||
slo_request = make_saml_sp_slo_request(security_options: { embed_sign: false }) | ||
params[:SAMLRequest] = slo_request['SAMLRequest'] | ||
params[:RelayState] = slo_request['RelayState'] | ||
params[:SigAlg] = slo_request['SigAlg'] | ||
|
@@ -138,5 +128,18 @@ def params | |
it 'should successfully validate signature' do | ||
expect(validate_saml_request).to eq(true) | ||
end | ||
|
||
context "solicited Response" do | ||
let(:principal) { double email_address: "[email protected]" } | ||
|
||
it "should create a SAML Logout Response" do | ||
expect(validate_saml_request).to eq(true) | ||
expect(saml_request.logout_request?).to eq true | ||
saml_response = encode_response(principal) | ||
response = OneLogin::RubySaml::Logoutresponse.new(saml_response, saml_settings) | ||
expect(response.validate).to eq(true) | ||
expect(response.issuer).to eq("http://idp.com/saml/idp") | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.