获取:Android应用程序上的ipRefererBlocked

时间:2015-11-12 23:03:21

标签: android google-identity-toolkit

我正在尝试使用“Google Identity Toolkit”和“教程”Android演示应用,但现在我收到此错误:

{
  "error": {
    "errors": [
      {
        "domain": "usageLimits",
        "reason": "ipRefererBlocked",
        "message": "There is a per-IP or per-Referer restriction configured on your API key and the request does not match these restrictions. Please use the Google Developers Console to update your API key configuration if request from this IP or referer should be allowed.",
        "extendedHelp": "https://console.developers.google.com"
      }
    ],
    "code": 403,
    "message": "There is a per-IP or per-Referer restriction configured on your API key and the request does not match these restrictions. Please use the Google Developers Console to update your API key configuration if request from this IP or referer should be allowed."
  }
}

任何想法?在谷歌控制台我需要允许一些东西?在哪里?

OAuth 2.0客户端ID:

机器人,
Web应用程序

在Identity Toolkit API控制台上,它允许我在Google提供商中选择“Web应用程序”客户端ID。

我已经在我的“教程”应用程序中设置了这个

2 个答案:

答案 0 :(得分:1)

当您尝试在未添加到控制台中的引荐来源网址的网址上运行代码时,通常会导致此错误。

要解决此问题,请转到Google Developer Console,然后在API Manager下单击凭据并找到您的浏览器密钥。在此页面上,您可以添加将使用该密钥的任何URL。 记住它对待www。不同,所以要覆盖所有可能的页面,你可以这样做: .domain.com / domain.com / *

答案 1 :(得分:0)

你需要......

  1. 创建Android API密钥
  2. 设置签名密钥文件的包名称和SHA-1(请参阅gitkit指南,了解如何执行此操作)
  3. 将该API密钥用于identitytoolkit.api_key