Google-Oauth身份验证错误

Sam*_*Sam 3 authentication oauth google-authentication google-oauth ruby-on-rails-4

尝试使用google -oauth登录时出现以下错误.

I, [2014-04-23T10:08:24.349056 #4905]  INFO -- omniauth: (google_oauth2) Request phase initiated.

I, [2014-04-23T10:08:24.861288 #4905]  INFO -- omniauth: (google_oauth2) Request phase initiated.

I, [2014-04-23T10:08:28.637438 #4905]  INFO -- omniauth: (google_oauth2) Callback phase initiated.

E, [2014-04-23T10:08:30.207714 #4905] ERROR -- omniauth: (google_oauth2) Authentication failure! invalid_credentials: OAuth2::Error, {"errors"=>[{"domain"=>"usageLimits", "reason"=>"accessNotConfigured", "message"=>"Access Not Configured. Please use Google Developers Console to activate the API for your project."}], "code"=>403, "message"=>"Access Not Configured. Please use Google Developers Console to activate the API for your project."}: 

{

 "error": {

  "errors": [
   {
    "domain": "usageLimits",
    "reason": "accessNotConfigured",
    "message": "Access Not Configured. Please use Google Developers Console to activate the API for your project."
   }
  ],

  "code": 403,
  "message": "Access Not Configured. Please use Google Developers Console to activate the API for your project."
 }
}
Run Code Online (Sandbox Code Playgroud)

Bab*_*bar 7

答案在您的错误日志中,在您帐户的开发者设置中激活Google API.


Aut*_*ico 5

我在一些谷歌搜索后发现了这个问题,我对@ Babar的回答并不是很满意,因为它实际上并没有解决我的问题.

经过大量的挖掘后,我发现你必须在你的开发者控制台中启用Google+ API(有些人还说你需要Contacts API).之前我没有必要这样做,但显然已经出现了一些变化.

为此,请执行以下步骤:

  1. 转到https://console.developers.google.com/project
  2. 选择您的项目
  3. 按侧面板上的"API&auth"
  4. 从下拉列表中按"API"
  5. 查找并启用Google+ APIContacts API
  6. 启用它们之后,启动WAIT ABOUT 5 MINUTESAPI.

现在您应该能够再次使用Oauth2登录.