代码之家  ›  专栏  ›  技术社区  ›  Vinod Kumar Marupu

GCP CLoudStore REST参考

  •  0
  • Vinod Kumar Marupu  · 技术社区  · 8 年前

    在node js Google cloud store中使用REST引用,我在postman中得到了这个错误,我得到了以下错误。 URL: https://datastore.googleapis.com/v1/projects/ {projectId}:分配ID 需求主体:

     {
    "keys": [
    {
      "partitionId": {
        "namespaceId": "default",
        "projectId": "superb-watch-172816"
      },
      "path": [
        {
          "kind": "User50records"
        }
      ]
    }
    ]}
    

    { "error": { "code": 401, "message": "Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.", "status": "UNAUTHENTICATED" } }

    1 回复  |  直到 8 年前
        1
  •  1
  •   Brandon Yarbrough    8 年前

    不允许对云数据存储进行真正的匿名调用。您必须以某种方式向服务器标识自己。最基本的要求是附加一个API密钥,这基本上是一种声明,表明您与某个项目或其他项目有关联。如果您正在访问任何人都无法公开查看的数据,您还需要提供某种身份验证,这通常是通过OAuth完成的。

    因此,假设这是公共数据,则工作量最小:获取 an API key

    认证指南: https://cloud.google.com/docs/authentication/

    推荐文章