omniauth / omniauth-saml

A generic SAML strategy for OmniAuth

Home Page:https://github.com/omniauth/omniauth-saml

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Infinite redirect loops when using `before_action authenticate_user!` in controller

slalomandrew opened this issue · comments

Possibly just a chance of me being stupid, but I've followed the docs fairly religiously and found nothing. I've put details of my setup in an SO post here, but the gist of it is basically that my app isn't redirecting to the IDP to get creds. Instead, it seems to be redirecting to itself infinitely, causing an ERR_TOO_MANY_REDIRECTS.

It looks like the issue here is that user_saml_omniauth_authorize_path is redirecting to a controller which is also protected by before_action :authenticate_user!, though it's not obvious which controller that is.

@slalomandrew That helper is generated by Devise, not OmniAuth itself or omniauth-saml. What does bundle exec rake routes say? It sounds like your routes are not configured correctly.

It says a lot of things. Is there anything specific it should say? IE, a login path that might not exist and cause a redirect...?