"访问未配置"访问来自Web应用程序谷歌的云终端时 [英] "Access not configured" when accessing google cloud endpoints from web app
问题描述
我写了一个Web应用程序与angularjs前端,用于存储数据的谷歌应用程序引擎,并从前端客户端API访问谷歌的云终端。我测试了当地一切正常,但部署,访问来自前端JavaScript客户端给了我下面的错误API后:
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"
}
]
我检查部署后生产API探险家和它工作正常。此外,我试图直接访问由URL中的API也能正常工作。就在前端的客户端无法正常工作。任何想法?
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密钥在客户端与gapi.client.setApiKey(API_KEY);其中API密钥从云控制台浏览器的关键。我删除了这一点,它工作正常。我不知道该API密钥是什么。
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.
这篇关于"访问未配置"访问来自Web应用程序谷歌的云终端时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!