All requests are returned 403 Unauthorized

I am trying to work with cloud storage - I created an appengine project that can be viewed at https://cloud.google.com/console#/ .

Using the cloud console, I went to the APIs and disconnected and returned to the datastore API. Then I registered the app (web app, shared) and generated a certificate. I have ensured that the email received from this is in the "Commands" list with "Can Edit" permission.

After that, all requests I generate return 403. Requests to other APIs, such as the prediction API, work fine. The datastore returns 403 from both my codebase (using php api) and explorer api.

Below is a dump of an HTTP request generated with a PHP client. Any help would be greatly appreciated!

  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

      

0


source to share


1 answer


To work around this issue:

  • Visit Google Cloud Console .
  • Click on an existing Cloud project.
  • Click "Commands" in the settings menu.
  • Find the email address that matches your certificate (this will be a 45 character string followed by @ developer.gserviceaccount.com).
  • Remove and re-add this email address as a member of your project.


I have logged this in the public cloud storage tracking log: https://github.com/GoogleCloudPlatform/google-cloud-datastore/issues/10

Please check for updates.

+1


source







All Articles