简体   繁体   English

从网络应用访问Google Cloud端点时出现“未配置访问”

[英]“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.

相关问题 带有Google Cloud Endpoints的AngularJS表单 - AngularJS forms with Google Cloud Endpoints 在Google Cloud上部署移动网络应用 - Deploying Mobile web app on Google Cloud 页面加载时如何使用AngularJs调用Google Cloud Endpoints以获取用户信息(PICTURE,NAME ..) - How to call Google Cloud Endpoints with AngularJs when the page Loads, to get user information(PICTURE, NAME..) 从AngularJS APP访问Google Calendar API - Accessing Google Calendar API from AngularJS APP Javascript:如何通过网络应用程序使用Google API访问“特定用户”数据? - Javascript: how to access *specific user* data with Google API from web app? 加载视图Direclty时,“ Web服务器配置为不列出此目录的内容”(从其他页面导航时,则不如此) - “The Web server is configured to not list the contents of this directory” when loading the view Direclty (not when Naivgating from other page) 如何知道 web 应用程序可在浏览器或团队自定义应用程序上访问 - How to know that web app is access on browser or from teams custom app 管理从控制台应用程序到Azure上的Web API的访问 - Managing access from a Console App to a Web API on Azure HTTP错误405.0-从angularjs应用访问web-api时不允许使用方法 - HTTP Error 405.0 - Method Not Allowed while accessing web-api from angularjs app Google不再支持ionin应用程序中来自网络视图的身份验证请求 - Google no longer supports authentication requests from the web view in ionin app
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM