【发布时间】:2015-08-27 21:25:53
【问题描述】:
我的 Facebook 身份验证有效。但是,我的 twitter 登录仅适用于 localhost。我的谷歌根本不工作。 对于谷歌,我得到了错误:
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.
对于 Twitter,我在 heroku 上的生产中遇到了类似的问题,尽管 localhost 适用于 Twitter 登录。
我在 twitter 和 google 应用程序中设置的重定向 URI 是:
http://unstarv.herokuapp.com
虽然我在尝试登录这些应用程序后得到的 URL 是:
https://accounts.google.com/o/oauth2/auth?access_type=offline&client_id=XXXXXXXXXXXXXXXXXXXXX
http://unstarv.herokuapp.com/users/auth/twitter/callback?oauth_token=XXXXXXXXXXXXXXXXXXXXX
我是否正确设置了重定向和回调 URI?为什么 Twitter 登录在 localhost 上有效,但在 heroku 上无效? 谢谢!!!
【问题讨论】:
-
您是否在他们的控制台中为 google 设置了回调 uri?例如
http://unstarv.herokuapp.com/users/auth/google_oauth2/callback -
您的设计初始化程序中有任何配置吗?
标签: ruby-on-rails heroku twitter devise