[英]“Access not configured” when accessing google cloud endpoints from web app
I wrote a webapp with angularjs frontend, google app engine for storing data, and google cloud endpoints for api access from the frontend client. 我编写了一个webapp,其中包含angularjs前端,用于存储数据的Google App引擎和用于从前端客户端进行api访问的google cloud端点。 I tested everything fine locally, but after deploying, accessing the api from the frontend javascript client gives me the following error:
我在本地测试了一切正常,但是在部署之后,从前端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. 部署后,我已经检查了生产api资源管理器,并且工作正常。 Also, I tried directly accessing the api by URL which also works fine.
另外,我尝试通过URL直接访问api,它也可以正常工作。 Just the frontend client does not work.
只是前端客户端不起作用。 Any ideas?
有任何想法吗?
Turns out I set the API key in the client with gapi.client.setApiKey(API_KEY); 原来,我在客户端上使用gapi.client.setApiKey(API_KEY);设置了API密钥。 where the API Key is the browser key from the cloud console.
其中API密钥是云控制台中的浏览器密钥。 I removed this and it works fine.
我删除了它,它工作正常。 I have no idea what the API key is for.
我不知道API密钥是做什么用的。
I'm looking at the problem now on one of my projects. 我现在正在我的一个项目中查看问题。 Might be that the ipv6 address must be registered for the project.
可能是必须为该项目注册ipv6地址。 Take a look at this post Google API returning Access Not Configured
看看这篇文章Google API返回未配置访问权限
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. 通常的原因是,在请求时,尚未在Google Console中启用正在查询的API。 Once it is turned on - error goes away.
一旦打开,错误就会消失。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.