简体   繁体   English

当我尝试使用omniauth-google-oauth2 gem进行身份验证时,没有路由匹配[GET]“/ auth / google_apps”

[英]No route matches [GET] “/auth/google_apps” when I try to authenticate with omniauth-google-oauth2 gem

I have implemented twitter and facebook authentication with omniauth gem, but when i try to authenticate with openID or google I get: No route matches [GET] "/auth/google_apps" or No route matches [GET] "/auth/open_id" errors 我已经使用omniauth gem实现了twitter和facebook身份验证,但是当我尝试使用openID或google进行身份验证时,我得到:没有路由匹配[GET]“/ auth / google_apps”或没有路由匹配[GET]“/ auth / open_id”错误

My omniauth.rb file is: 我的omniauth.rb文件是:

require 'openid/store/filesystem'

Rails.application.config.middleware.use OmniAuth::Builder do
provider :openid, :store => OpenID::Store::Filesystem.new('/tmp'), :name => 'openid'
provider :openid, :store => OpenID::Store::Filesystem.new('/tmp'), :name => 'google', :identifier => 'https://www.google.com/accounts/o8/id'

And my routes.rb is that: 而我的routes.rb是这样的:

match '/auth/:provider/callback', to: 'authentications#create'

And my Gemfile is this: 我的Gemfile是这样的:

#for user authentication
gem 'devise'
gem 'omniauth'
gem 'omniauth-twitter'
gem 'omniauth-facebook'
gem 'omniauth-openid'
gem 'omniauth-google-oauth2'

I have to put anything else in my code to run OpenID and google authentication? 我必须在我的代码中添加其他任何东西来运行OpenID和谷歌身份验证? thanks 谢谢

Your calls are erroneous. 你的电话是错误的。 You should call : 你应该致电:

/auth/google
provider :openid, :store => OpenID::Store::Filesystem.new('./tmp')

请改用此代码,并链接/ auth / google

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用omniauth-google-oauth2 gem进行设计 - Devise with omniauth-google-oauth2 gem Rails,使用omniauth-google-oauth2获取circledByCount - Rails, get circledByCount with omniauth-google-oauth2 使用omniauth-google-oauth2 gem从auth哈希中检索first_name和last_name - retrieve first_name and last_name from auth hash using omniauth-google-oauth2 gem 使用MiniTest,当尝试测试“ omniauth-google-oauth2” gem时,我一直收到302重定向到我的sign_in路径 - Using MiniTest, when trying to test `omniauth-google-oauth2` gem I keep getting a 302 redirect to my sign_in path 在Rails 2.3.8和ruby 1.8.7中使用omniauth-google-oauth2 gem - Using omniauth-google-oauth2 gem in rails 2.3.8 and ruby 1.8.7 如何在Rails中使用具有增量授权的omniauth-google-oauth2 gem? - How to use omniauth-google-oauth2 gem with incremental authorization in Rails? 如何编写Rails 4测试以使用omniauth-google-oauth2 gem创建会话? - How can I write a Rails 4 test for creating a session with the omniauth-google-oauth2 gem? 在 rails API 中使用 omniauth-google-oauth2 - Using omniauth-google-oauth2 in rails API devise + omniauth-google-oauth2调用错误 - devise + omniauth-google-oauth2 calling errors 通过 Ruby、Rails 和 'omniauth-google-oauth2'gem 访问 Google oath2 失败 - Google oath2 access via Ruby, Rails and 'omniauth-google-oauth2'gem failing
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM