diff --git a/lib/omniauth/strategies/saml.rb b/lib/omniauth/strategies/saml.rb index b43e56d..1a36e52 100644 --- a/lib/omniauth/strategies/saml.rb +++ b/lib/omniauth/strategies/saml.rb @@ -80,8 +80,17 @@ def response_fingerprint Digest::SHA1.hexdigest(cert.to_der).upcase.scan(/../).join(':') end + def on_metadata_path? + if options[:metadata_path].respond_to?(:call) + options[:metadata_path].call(env) + else + metadata_path = options[:metadata_path] || "#{request_path}/metadata" + on_path?(metadata_path) + end + end + def other_phase - if on_path?("#{request_path}/metadata") + if on_metadata_path? # omniauth does not set the strategy on the other_phase @env['omniauth.strategy'] ||= self setup_phase