网址似乎正确(昨天最后更新):
文件也是:
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 …:
但仍然有相同的错误.
解决方法
原文地址:https://www.jb51.cc/ruby/273663.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。