-
Notifications
You must be signed in to change notification settings - Fork 207
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from bpedro/feature/validate-idp-certificate-o…
…n-callback Validate an idp fingerprint using a configurable lambda
- Loading branch information
Showing
6 changed files
with
58 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module OmniAuth | ||
module SAML | ||
VERSION = '1.2.0' | ||
VERSION = '1.3.0' | ||
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
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 |
---|---|---|
|
@@ -11,7 +11,7 @@ Gem::Specification.new do |gem| | |
gem.email = '[email protected]' | ||
gem.homepage = 'https://github.com/PracticallyGreen/omniauth-saml' | ||
|
||
gem.add_runtime_dependency 'omniauth', '~> 1.2' | ||
gem.add_runtime_dependency 'omniauth', '~> 1.1' | ||
gem.add_runtime_dependency 'ruby-saml', '~> 0.7.3' | ||
|
||
gem.add_development_dependency 'rspec', '~> 2.8' | ||
|
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 |
---|---|---|
|
@@ -84,6 +84,27 @@ def post_xml(xml=:example_response) | |
end | ||
end | ||
|
||
context "when fingerprint is empty and there's a fingerprint validator" do | ||
before :each do | ||
saml_options.delete(:idp_cert_fingerprint) | ||
saml_options[:idp_cert_fingerprint_validator] = lambda { |fingerprint| "C1:59:74:2B:E8:0C:6C:A9:41:0F:6E:83:F6:D1:52:25:45:58:89:FB" } | ||
post_xml | ||
end | ||
|
||
it "should set the uid to the nameID in the SAML response" do | ||
auth_hash['uid'].should == '_1f6fcf6be5e13b08b1e3610e7ff59f205fbd814f23' | ||
end | ||
|
||
it "should set the raw info to all attributes" do | ||
auth_hash['extra']['raw_info'].to_hash.should == { | ||
'first_name' => 'Rajiv', | ||
'last_name' => 'Manglani', | ||
'email' => '[email protected]', | ||
'company_name' => 'Example Company' | ||
} | ||
end | ||
end | ||
|
||
context "when there is no SAMLResponse parameter" do | ||
before :each do | ||
post '/auth/saml/callback' | ||
|