【问题标题】:Google-Oauth authentication errorGoogle-Oauth 身份验证错误
【发布时间】:2014-06-07 17:47:14
【问题描述】:

尝试使用 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."
 }
}

【问题讨论】:

    标签: authentication ruby-on-rails-4 oauth google-oauth google-authentication


    【解决方案1】:

    我的 Rails 应用程序也遇到了类似的问题,抛出错误 403。所以我通过在终端中运行 bundle update devise omniauth omniauth-google-oauth2 来升级omniauth gems 来解决它。

    【讨论】:

      【解决方案2】:

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

      经过大量挖掘,我发现您必须在开发人员控制台中启用Google+ APIsome also say 您需要Contacts API)。我以前不必这样做,但显然已经发生了一些变化。

      为此,请执行以下步骤:

      1. 转到https://console.developers.google.com/project
      2. 选择您的项目
      3. 从侧面板按“APIs & auth”
      4. 从下拉菜单中按“API”
      5. 查找并启用Google+ APIContacts API
      6. 启用后,WAIT ABOUT 5 MINUTES 以便 API 启动。

      现在您应该可以再次使用 Oauth2 登录了。

      【讨论】:

      • 这是一个更好的答案......终于感谢我有设计工作的 oauth2
      【解决方案3】:

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

      【讨论】:

      • 链接是什么?
      • Google 开发者控制台位于 console.developers.google.com/project?authuser=0
      • 应该启用哪个 API?没有“Google API”之类的东西,也没有“auth”或“credentials”之类的东西..
      • @Cort3z 您上面的评论有指向您授予项目访问权限的登录页面的链接,类似于 facebook api
      • @Babar 是的。你还是没有回答问题。
      猜你喜欢
      • 2016-03-27
      • 2015-08-23
      • 1970-01-01
      • 1970-01-01
      • 2016-11-14
      • 2015-04-28
      • 2017-01-04
      • 1970-01-01
      相关资源
      最近更新 更多