Skip to content

Commit

Permalink
Validate the SAML response
Browse files Browse the repository at this point in the history
* now requires ruby 1.9.2+
* use xmlcanonicalizer gem
  • Loading branch information
whilefalse authored and rajiv committed Mar 29, 2012
1 parent 0ef28b1 commit 0f5ec78
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lib/omniauth/strategies/saml.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ def callback_phase
begin
response = OmniAuth::Strategies::SAML::AuthResponse.new(request.params['SAMLResponse'])
response.settings = options
response.validate!

@name_id = response.name_id
@attributes = response.attributes

return fail!(:invalid_ticket, 'Invalid SAML Ticket') if @name_id.nil? || @name_id.empty?
super
rescue ArgumentError => e
Expand Down
2 changes: 1 addition & 1 deletion omniauth-saml.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Gem::Specification.new do |gem|
gem.homepage = "https://github.com/PracticallyGreen/omniauth-saml"

gem.add_runtime_dependency 'omniauth', '~> 1.0'
gem.add_runtime_dependency 'XMLCanonicalizer', '~> 1.0.1'
gem.add_runtime_dependency 'xmlcanonicalizer'
gem.add_runtime_dependency 'uuid', '~> 2.3'

gem.files = ['README.md'] + Dir['lib/**/*.rb']
Expand Down

0 comments on commit 0f5ec78

Please sign in to comment.