Skip to content

Commit

Permalink
Added on_metadata_path? for v1.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeckr committed Oct 23, 2016
1 parent f4b6b33 commit 8e9dea2
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/omniauth/strategies/saml.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8e9dea2

Please sign in to comment.