“Access not configured” when accessing google clou

2019-05-28 23:19发布

I wrote a webapp with angularjs frontend, google app engine for storing data, and google cloud endpoints for api access from the frontend client. I tested everything fine locally, but after deploying, accessing the api from the frontend javascript client gives me the following error:

[
 {
  "error": {
   "code": 403,
   "message": "Access Not Configured",
   "data": [
    {
     "domain": "usageLimits",
     "reason": "accessNotConfigured",
     "message": "Access Not Configured"
    }
   ]
  },
  "id": "gapiRpc"
 }
]

I've checked the production api explorer after deployment and it works fine. Also, I tried directly accessing the api by URL which also works fine. Just the frontend client does not work. Any ideas?

3条回答
女痞
2楼-- · 2019-05-28 23:53

Turns out I set the API key in the client with gapi.client.setApiKey(API_KEY); where the API Key is the browser key from the cloud console. I removed this and it works fine. I have no idea what the API key is for.

查看更多
仙女界的扛把子
3楼-- · 2019-05-28 23:59

I'm looking at the problem now on one of my projects. Might be that the ipv6 address must be registered for the project. Take a look at this post Google API returning Access Not Configured

查看更多
狗以群分
4楼-- · 2019-05-29 00:06

The usual reason for this is that the API, which is being queried is not yet enabled in Google Console by the time of the request. Once it is turned on - error goes away.

查看更多
登录 后发表回答