You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Omniauth failed to detect the url -> Authentication passthru #1079
always returning false. Then the middleware do not catch the route and it always ends up with Authentication passthru (note that is only hapenning on my production env, not on my local dev)
An easy fix is to change the method to following
to
def on_path?(path)
current_path.squeeze("/").casecmp(path.squeeze("/")).zero?
end
I know this is probably a problem linked to my app, but I have struggling 4hours on this. It's a easy change that could save time for others
Thank you !
Sebastian
Ps: sorry I have been lazy for not submitting a PR for such small change
Just to +1 this, such a messy bug to catch. My setup was a NGINX proxy_pass in a Dockerfile routing /api to http://rails:3000/.
The bug is that in NGINX if your location /api/ { line doesn't END(!!!) with a tailing-slash, then the trailing slash isn't removed when it's passed to Rails, meaning that Omniauth see's //users/auth/microsoft_graph_auth which it declares as invalid. Jury's out on whether that's right or wrong given technically they are two different URLs, but yeah.
Fixed in de5f985: OmniAuth now collapses repeated slashes in the request path, as Rails routing does, so //users/auth/xxx from a proxy matches the strategy. This will ship in 2.2.0.
Activity
tomatkapitalise commentedon Sep 11, 2022
Just to +1 this, such a messy bug to catch. My setup was a NGINX proxy_pass in a Dockerfile routing
/apitohttp://rails:3000/.The bug is that in NGINX if your
location /api/ {line doesn't END(!!!) with a tailing-slash, then the trailing slash isn't removed when it's passed to Rails, meaning that Omniauth see's//users/auth/microsoft_graph_authwhich it declares as invalid. Jury's out on whether that's right or wrong given technically they are two different URLs, but yeah.Either way, half my weekend spent on a missing
/.Collapse repeated slashes in the current path
sferik commentedon Oct 20, 2026
Fixed in de5f985: OmniAuth now collapses repeated slashes in the request path, as Rails routing does, so
//users/auth/xxxfrom a proxy matches the strategy. This will ship in 2.2.0.