Let's say that I have to connect with facebook.
My app works perfectly if i call
but when i try to call
there is no request.env[ "omniauth.auth" ]
Any ideas of what's going on? (I'll provide more additional info if asked. not sure what else is needed)
Though I'm having the issue with a a custom provider - working on ownership of both the provider and the client
Thanks @andrei4002 , you solved an issue of mine... can't figure out why callback.js wouldn't work... anyway callback?format=js does the trick for us ;)
Same problem here on a rails-api app which renders just json. In my case a Google Api redirect_uri can't be with parameters, when I try to add ?format=json in console and midddleware initializer I get
(google) Authentication failure! invalid_credentials: OAuth2::Error, redirect_uri_mismatch:
"error" : "redirect_uri_mismatch"
Seems that I will have to respond to html and set session manually.
+1 to this issue. Does anyone know the root cause why .json doesn't work?
Still open after 3 years? Have the same issue, and it really should get fixed..
Still causing headaches in 2016
I browsed a little and it seems that in https://github.com/intridea/omniauth/blob/master/lib/omniauth/strategy.rb,
callback_path is hardcoded to be /auth/facebook/callback, and when current_path is compared to expected strategy's path (current_path.casecmp(path) == 0) the test fails and omniauth doesn't kick in.
current_path.casecmp(path) == 0
Quick fix: use ?format=json