当从web应用程序访问谷歌云端点时,“访问未配置”

时间:2022-08-22 11:07:01

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:

我与angularjs frontend一起编写了一个webapp,谷歌应用引擎用于存储数据,谷歌云端点用于从frontend客户端访问api。我在本地测试了所有的东西,但是在部署之后,从前端javascript客户端访问api给了我以下错误:

[
 {
  "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?

我在部署后检查了生产api资源管理器,它运行良好。另外,我尝试通过URL直接访问api,这也很有效。只是前端客户端不工作。什么好主意吗?

3 个解决方案

#1


3  

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.

我用gapi.client.setApiKey(API_KEY)在客户端设置API key;API键是云控制台的浏览器键。我把它去掉了,效果很好。我不知道API的关键是什么。

#2


0  

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

我正在我的一个项目中研究这个问题。可能是该项目必须注册ipv6地址。看看这个post -谷歌API返回未配置的访问权限。

#3


0  

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.

通常的原因是正在查询的API在请求时尚未在谷歌控制台中启用。一旦打开,错误就会消失。

#1


3  

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.

我用gapi.client.setApiKey(API_KEY)在客户端设置API key;API键是云控制台的浏览器键。我把它去掉了,效果很好。我不知道API的关键是什么。

#2


0  

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

我正在我的一个项目中研究这个问题。可能是该项目必须注册ipv6地址。看看这个post -谷歌API返回未配置的访问权限。

#3


0  

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.

通常的原因是正在查询的API在请求时尚未在谷歌控制台中启用。一旦打开,错误就会消失。