我正在使用Rails 4.2.5并且我正在尝试通过Google启用身份验证以允许访问我的应用程序。我正在关注https://www.digitalocean.com/community/tutorials/how-to-configure-devise-and-omniauth-for-your-rails-application'>devise教程。我添加了这些宝石
gem 'devise'
gem 'omniauth'
gem 'omniauth-digitalocean'
gem 'omniauth-google'
同样遵循本教程中的其他步骤,包括将google作为OAuth提供程序添加到config / initializers / devise.rb文件中的devise配置中......
config.omniauth :google, “myclientid”, “myclientsecret”
当我启动并运行我的Rails服务器时,我可以在
看到我的注册页面http://localhost:3000/users/sign_in
当我点击“使用Google登录”时,指向此网址 - http://localhost:3000/users/auth/google,我收到此错误...
OAuth::Unauthorized
400 Bad Request
Extracted source (around line #216):
self.token_request(http_method, uri.path, token, request_options, arguments)
when (400..499)
raise OAuth::Unauthorized, response
else
response.error!
end
任何人都知道我忽略了什么?