[英]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.