2013-07-26 125 views
0

我试图与云数据存储一起工作 - 我创建了一个可在https://cloud.google.com/console#/处查看的appengine项目。所有请求返回403未授权

通过云控制台,我已导航到API,并关闭并返回到数据存储区API。然后我注册了一个应用程序(Web应用程序,通用)并生成了一个证书。我已确保由此生成的电子邮件位于“可编辑”权限的“团队”列表中。

毕竟,我产生的任何请求都返回403.对其他API(如预测API)的请求工作正常。数据存储从我的代码库(使用php api)或从api浏览器返回403。

下面是从PHP客户端生成的HTTP请求的转储。任何帮助将不胜感激!

object(Google_HttpRequest)[15] 
    private 'batchHeaders' => 
    array (size=4) 
     'Content-Type' => string 'application/http' (length=16) 
     'Content-Transfer-Encoding' => string 'binary' (length=6) 
     'MIME-Version' => string '1.0' (length=3) 
     'Content-Length' => string '' (length=0) 
    protected 'url' => string 'https://www.googleapis.com/datastore/v1beta1/datasets/madlab-sandbox/lookup' (length=75) 
    protected 'requestMethod' => string 'POST' (length=4) 
    protected 'requestHeaders' => 
    array (size=3) 
     'content-type' => string 'application/json; charset=UTF-8' (length=31) 
     'content-length' => int 62 
     'authorization' => string 'Bearer ya29.AHES6ZSfJmWHLNIrPwQA7wZ3miGCMgxvmUmYl65mfw9J2_v8KgmLMyJV' (length=68) 
    protected 'postBody' => string '{"keys":[{"path":[{"id":"5629499534213120","kind":"topic"}]}]}' (length=62) 
    protected 'userAgent' => string 'test google-api-php-client/0.6.4' (length=32) 
    protected 'responseHttpCode' => int 403 
    protected 'responseHeaders' => 
    array (size=9) 
     'content-type' => string 'application/json; charset=UTF-8' (length=31) 
     'date' => string 'Fri, 26 Jul 2013 15:26:13 GMT' (length=29) 
     'expires' => string 'Fri, 26 Jul 2013 15:26:13 GMT' (length=29) 
     'cache-control' => string 'private, max-age=0' (length=18) 
     'x-content-type-options' => string 'nosniff' (length=7) 
     'x-frame-options' => string 'SAMEORIGIN' (length=10) 
     'x-xss-protection' => string '1; mode=block' (length=13) 
     'server' => string 'GSE' (length=3) 
     'transfer-encoding' => string 'chunked' (length=7) 
    protected 'responseBody' => string '{ 
"error": { 
    "errors": [ 
    { 
    "domain": "global", 
    "reason": "PERMISSION_DENIED", 
    "message": "Unauthorized." 
    } 
    ], 
    "code": 403, 
    "message": "Unauthorized." 
} 
} 
' (length=182) 
    public 'accessKey' => null 

回答

1

要解决此问题:

  • 参观Google Cloud Console
  • 点击您现有的云项目。
  • 点击设置菜单下的“团队”。
  • 找到与您的证书相对应的电子邮件地址(它将是一个~45个字符的字符串,然后是@ developer.gserviceaccount.com)。
  • 删除然后重新添加此电子邮件地址作为您的项目的成员。

我已提起诉讼,这对云存储的公开问题追踪: https://github.com/GoogleCloudPlatform/google-cloud-datastore/issues/10

请检查有没有更新。

+0

谢谢你。不幸的是,它仍然没有解决我的问题。我跟进了你在github上创建的问题(我不确定哪个更适合跟进)。谢谢。 – user2623331

+0

只需跟随此 - 显然我创建的第一个应用程序似乎永久搞砸了。我创建了一个新的appengine应用程序,通过云控制台启用了数据存储区api,但它仍然无法工作。然而,然后按照上面的说明最终得到的东西正常工作。 – user2623331