intridea/omniauth — Issue #553: A request to add env['SCRIPT_NAME'] before on_failure path
Author: toyokazu
Created: 2011-12-13 03:17:32+00:00
State: open

Hi,

Current implementation of on_failure seems not to consider application prefix
like 'sub URI' in Passenger. If possible, would you insert env['SCRIPT_NAME']
into new_path?

% vi lib/omniauth.rb
...
:on_failure => Proc.new do |env|
message_key = env['omniauth.error.type']
new_path = "#{env['SCRIPT_NAME']}#{OmniAuth.config.path_prefix}/failure?message=#{message_key}"
[302, {'Location' => new_path, 'Content-Type'=> 'text/html'}, []]
end,
...

The failure message is important for the frontend module base authentication
systems like Shibboleth, OpenSSO. Before configuring frontend authentication,
only the failure message can give users a hint to fix the issue why then can not
log in.

Thank you.