Using OmniAuth, Rails 3.1.0.rc2, mysql2, ruby 1.9.2.p0.
I still get this when redirecting back to my site.
/auth/failure?message=invalid_response
Omniauth.rb
Rails.application.config.middleware.use OmniAuth::Builder do
provider :twitter, 'XXXXX', 'XXXXXXXXXXXXX'
I've checked the keys 100x and they are correct. Still getting the invalid response. Any of the questions I see don't seem to work.
Any help would be greatly appreciated!
Thanks. [:
If any new information is needed, just ask.
If you use this request.env['rack.auth']
in your controller, change this to request.env['omniauth.auth']
- this were explained here OmniAuth
this solution works for me.
I had a similar problem. It turns out that I actually had some runtime errors in my Users::OmniauthCallbacksController#twitter method:
I was calling a method on a non-existent method on a nil object and this was raising an exception, but either devise or omniauth were swallowing the exception.
I ended up wrapping my entire method body in a begin/rescue clause and printing out the exception.
However, if you are getting Invalid Credentials then it's likely that the twitter-issued oauth key has expired and so your user should really be calling /users/auth/twitter again.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With