Twitch Oauth success redirect "404 page not found"

After a successful Oauth flow, Twitch seems to be redirecting to https://id.twitch.tv (no extra path or query params) and not the root path of my app as it should.

image

This happens only on 2 of the 3 sign in buttons. One of them redirects ok.

After a few hours of debugging, I can’t find why 2 out of the 3 buttons are triggering this failed redirect, since they generate exactly the same Oauth URL:

https://id.twitch.tv/oauth2/authorize?client_id=<hidden>&redirect_uri=https%3A%2F%2Fwww.framedrop.co%2Fusers%2Fauth%2Ftwitch%2Fcallback&response_type=code&scope=user%3Aread%3Aemail&state=<hidden>

Does anyone have an idea of where to look to track this bug?

Thanks!

ClientID’s are public no need to censore them

Would suggest that your callback is redirecting back to id.twitch.

Check your access log or chrome network tools (preserve log)

And follow the flow.

It’s 99% likely to be something your side/in your implementation

Thanks @BarryCarlyon. Yeah I figured the issue would be on my side for sure.

Think I tracked it down - apparently some confusion with the ORIGIN header and the ruby omniauth library. I was getting a Twitch URL in the wrong place.

Solved, thanks!