codigomonstruo
codigomonstruo

Reputation: 1091

How do I correctly set up Omniauth + Devise + multiple providers

My facebook authentication works. My twitter login however only works on localhost. My google does not work at all. For google, I get the error:

400. That’s an error.
Error: redirect_uri_mismatch
The redirect URI in the request: http://unstarv.herokuapp.com/users/auth/google_oauth2/callback did not match a registered redirect URI.

For Twitter I get a similar problem in production on heroku though localhost works for Twitter login.

The Redirect URI I set up in both the twitter and google apps is :

  http://unstarv.herokuapp.com

While the URLs I get after trying to log in these apps are:

https://accounts.google.com/o/oauth2/auth?access_type=offline&client_id=XXXXXXXXXXXXXXXXXXXXX
http://unstarv.herokuapp.com/users/auth/twitter/callback?oauth_token=XXXXXXXXXXXXXXXXXXXXX

Did I set up correctly my redirect & Callback URI s ? How come the Twitter login works on localhost but not on heroku ? Thanks !!!

Upvotes: 0

Views: 141

Answers (1)

Perdana Adhitama
Perdana Adhitama

Reputation: 33

You shoud add this in your google console

http://unstarv.herokuapp.com/users/auth/google_oauth2/callback

While on Twitter I set

http://unstarv.herokuapp.com/ as a callback URL

Upvotes: 1

Related Questions