Skip to content

Commit

Permalink
call setup_phase during other_phase only if the path matches.
Browse files Browse the repository at this point in the history
* fixes #20.
  • Loading branch information
rajiv committed Dec 10, 2013
1 parent 50c29d4 commit d0e63de
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/omniauth/strategies/saml.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ def callback_phase
end

def other_phase
# omniauth does not set the strategy on the other_phase
@env['omniauth.strategy'] ||= self
setup_phase

if on_path?("#{request_path}/metadata")
# omniauth does not set the strategy on the other_phase
@env['omniauth.strategy'] ||= self
setup_phase

response = Onelogin::Saml::Metadata.new
settings = Onelogin::Saml::Settings.new(options)
Rack::Response.new(response.generate(settings), 200, { "Content-Type" => "application/xml" }).finish
Expand Down

0 comments on commit d0e63de

Please sign in to comment.