【发布时间】:2012-11-02 23:35:40
【问题描述】:
网址看起来正确(昨天最后一次更新):
文件也是:
omniauth.rb:
provider :google_oauth2, 'MY_CLIENT_ID.apps.googleusercontent.com', 'MY_CLIENT_SECRET',
:scope => 'https://mail.google.com/mail/feed/atom/'
Error: redirect_uri_mismatch
The redirect URI in the request: http://localhost:3000/auth/google_oauth2/callback did not match a registered redirect URI
header.html.erb
<li><%= link_to "Sign in with Google", "auth/google_oauth2" %></li>
routes.rb:
match '/auth/:provider/callback', to: 'sessions#omniauth_create'
但我明白了:
> Error: redirect_uri_mismatch The redirect URI in the request:
> http://localhost:3000/auth/google_oauth2/callback did not match a
> registered redirect URI
(Twitter 和 Facebook OmniAuth 运行良好)
不确定是什么问题。有什么建议可以解决这个问题吗?
编辑
我把 URI 改成了http...:
但仍然出现同样的错误。
【问题讨论】:
-
试试这个答案,它对我有用stackoverflow.com/a/41466634/1770571