-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9f56778
commit a98e44b
Showing
5 changed files
with
79 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,20 +18,50 @@ def params | |
saml_acs_url.should == requested_saml_acs_url | ||
end | ||
|
||
it "should create a SAML Response" do | ||
requested_saml_acs_url = "https://foo.example.com/saml/consume" | ||
saml_config = saml_settings(requested_saml_acs_url) | ||
auth_request = Onelogin::Saml::Authrequest.new | ||
auth_url = auth_request.create(saml_config) | ||
params[:SAMLRequest] = CGI.unescape(auth_url.split("=").last) | ||
validate_saml_request | ||
saml_response = encode_SAMLResponse("[email protected]") | ||
context "SAML Responses" do | ||
before(:each) do | ||
requested_saml_acs_url = "https://foo.example.com/saml/consume" | ||
@saml_config = saml_settings(requested_saml_acs_url) | ||
auth_request = Onelogin::Saml::Authrequest.new | ||
auth_url = auth_request.create(@saml_config) | ||
params[:SAMLRequest] = CGI.unescape(auth_url.split("=").last) | ||
validate_saml_request | ||
end | ||
|
||
response = Onelogin::Saml::Response.new(saml_response) | ||
response.name_id.should == "[email protected]" | ||
response.issuer.should == "http://example.com" | ||
response.settings = saml_config | ||
response.is_valid?.should be_true | ||
it "should create a SAML Response" do | ||
saml_response = encode_SAMLResponse("[email protected]") | ||
response = Onelogin::Saml::Response.new(saml_response) | ||
response.name_id.should == "[email protected]" | ||
response.issuer.should == "http://example.com" | ||
response.settings = @saml_config | ||
response.is_valid?.should be_true | ||
end | ||
|
||
[:sha1, :sha256].each do |algorithm_name| | ||
it "should create a SAML Response using the #{algorithm_name} algorithm" do | ||
self.algorithm = algorithm_name | ||
saml_response = encode_SAMLResponse("[email protected]") | ||
response = Onelogin::Saml::Response.new(saml_response) | ||
response.name_id.should == "[email protected]" | ||
response.issuer.should == "http://example.com" | ||
response.settings = @saml_config | ||
response.is_valid?.should be_true | ||
end | ||
end | ||
|
||
[:sha384, :sha512].each do |algorithm_name| | ||
it "should create a SAML Response using the #{algorithm_name} algorithm" do | ||
pending "release of ruby-saml v0.5.4" do | ||
self.algorithm = algorithm_name | ||
saml_response = encode_SAMLResponse("[email protected]") | ||
response = Onelogin::Saml::Response.new(saml_response) | ||
response.name_id.should == "[email protected]" | ||
response.issuer.should == "http://example.com" | ||
response.settings = @saml_config | ||
response.is_valid?.should be_true | ||
end | ||
end | ||
end | ||
end | ||
|
||
private | ||
|