1

我想测试来自 Proximity Beacon API 的一些 API 请求。所以我按照这个站点的步骤,将一个测试重定向 url ( https://developers.google.com/oauthplayground ) 放入 OAuth-2.0-Client-ID。当我尝试从操场发出请求时,我得到以下输出:

{
  "error": {
    "status": "PERMISSION_DENIED", 
    "message": "Google Proximity Beacon API has not been used in project google.com:oauth-2-playground before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/proximitybeacon.googleapis.com/overview?project=google.com:oauth-2-playground then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.", 
    "code": 403, 
    "details": [
      {
        "@type": "type.googleapis.com/google.rpc.Help", 
        "links": [
          {
            "url": "https://console.developers.google.com/apis/api/proximitybeacon.googleapis.com/overview?project=google.com:oauth-2-playground", 
            "description": "Google developers console API activation"
          }
        ]
      }
    ]
  }
}

显然它使用了错误的项目,但我只到了一个可以选择我的帐户但不是我的项目的步骤。我检查了两次,我唯一的猜测是我不能使用这个redirect_url。

所以我的问题是:为什么要尝试使用项目google.com:oauth-2-playground而不是我的?我该如何改变呢?

4

1 回答 1

3

在 OAuth 2.0 Playground 使用的默认凭据上未启用 Proximity Beacon API。我刚刚启用了该 API,现在应该可以使用了。

或者,您可以在 Playground 的配置菜单中设置 OAuth 2.0 Playground 以使用您自己的应用程序的 OAuth 凭据(客户端 ID 和客户端密码)。

于 2016-10-10T12:23:57.750 回答