【问题标题】:GoogleAuthUtil: Daily Limit for Unauthenticated Use Exceeded [closed]GoogleAuthUtil:已超过未经身份验证使用的每日限制 [关闭]
【发布时间】:2012-10-26 07:28:39
【问题描述】:

我正在使用 Google Client API 和 GoogleAuthUtil.class 来访问用户的 Google Drive 帐户。

String scope = "oauth2:" + DriveScopes.DRIVE;
String token = GoogleAuthUtil.getToken(getContext(), account.name, scope);

这就是全部的魔法。它工作了一整天,但几个小时后,我在发送 API 调用时收到以下消息:

com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden
 {
   "code": 403,
   "errors": [
     {
       "domain": "usageLimits",
       "message": "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup.",
       "reason": "dailyLimitExceededUnreg",
       "extendedHelp": "https://code.google.com/apis/console"
     }
   ],
   "message": "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup."
}

我不知道如何使用控制台中的 API 密钥而不是 oauth2 身份验证。 有两种不同的“getToken()”消息。一个有四个参数,最后一个的描述是:

extras:包含可能与 认证范围。

但是这些信息应该是什么样的?我必须在 Bundle 中放入哪些信息?

【问题讨论】:

  • 如何注册?应该很容易吧?
  • 我已注册并拥有所有这些 API 密钥。但是我应该如何将这些密钥放入捆绑包中? bundle.putString("WHAT_KEY_RIGHT_HERE", API_KEY); ???

标签: android oauth


【解决方案1】:

丹宁。我一直收到一个有效的令牌,但我从来没有用它来执行请求...... 我的解决方案:

GoogleCredential c = new GoogleCredential();
c.setAuthToken(myNewCoolToken);

大错特错...

【讨论】:

  • 嘿@Robert Hahn,这曾经对我有用,但就在几天前它停止工作,现在它抛出这个错误 com.google.android.gms.auth.GoogleAuthException: Unknown。知道为什么吗?我的瞄准镜有问题吗? gist.github.com/lawloretienne/7351151
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2023-04-06
  • 2016-05-29
  • 2016-07-26
  • 1970-01-01
  • 2020-04-17
  • 2017-09-06
  • 1970-01-01
相关资源
最近更新 更多