From 47e092c72783cdc7f27f60880823b8344f53634c Mon Sep 17 00:00:00 2001 From: Steven Anderson Date: Thu, 8 Mar 2012 16:35:14 +0000 Subject: [PATCH] Made the response actually validate, and used a different version of xmlcanonicalizer which works (I was getting weird issues with the other one) --- lib/omniauth/strategies/saml.rb | 3 +++ omniauth-saml.gemspec | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/omniauth/strategies/saml.rb b/lib/omniauth/strategies/saml.rb index 0f35d2a9..80ee17aa 100644 --- a/lib/omniauth/strategies/saml.rb +++ b/lib/omniauth/strategies/saml.rb @@ -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 diff --git a/omniauth-saml.gemspec b/omniauth-saml.gemspec index 8b1ef732..f65bf1d0 100644 --- a/omniauth-saml.gemspec +++ b/omniauth-saml.gemspec @@ -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']