App Engine 管理 API 错误 – 需要 “appengine.applications.create” 权限。

huangapple go评论77阅读模式
英文:

App Engine Admin API Error - The "appengine.applications.create" permission is required

问题

我们想要使用App Engine Admin API(REST)和Golang自动创建项目ID并安装我们的ULAPPH Cloud Desktop应用程序。

我们已经成功获取了令牌,但是当我们尝试创建项目ID时,出现了以下错误。

[响应OK] 成功连接到Appengine Admin API。
[令牌] { "access_token" : "TOKEN_HERE", "expires_in" : 3599, "token_type" : "Bearer" }

[响应代码] 403
[响应体] { "error": { "code": 403, "message": "操作不允许", "status": "PERMISSION_DENIED", "details": [ { "@type": "type.googleapis.com/google.rpc.ResourceInfo", "resourceType": "gae.api", "description": "需要"appengine.applications.create"权限。" } ] } }

我们只是使用REST API调用。如上所示,令牌请求成功,并且范围也是正确的。现在,当我们发送创建应用程序的请求时,出现了要求“appengine.application.create”权限的错误。

我们如何指定权限?

为什么会出现这个错误的可能原因?我们是否在JSON或查询中漏掉了某个字段?

根据下面的链接,我们只需要传递包含ID和位置的JSON。我们还只需要在Authorization头中传递令牌。我在访问YouTube、Drive等API时已经成功使用了相同的逻辑,所以不确定需要做什么,因为我已经按照文档进行了操作。

我还在Google Groups中发布了相同的问题,现在正在等待他们的回复。

英文:

We would like to automatically create a project ID and install our ULAPPH Cloud Desktop application using the App Engine Admin API (REST) and Golang.
https://cloud.google.com/appengine/docs/admin-api/?hl=en_US&_ga=1.265860687.1935695756.1490699302
https://ulapph-public-1.appspot.com/articles?TYPE=ARTICLE&DOC_ID=3&SID=TDSARTL-3

We were able to get a token but when we tried to create a project ID, we get the error below.

[Response OK] Successful connection to Appengine Admin API.
[Token] { "access_token" : "TOKEN_HERE", "expires_in" : 3599, "token_type" : "Bearer" }

[Response Code] 403
[Response Body] { "error": { "code": 403, "message": "Operation not allowed", "status": "PERMISSION_DENIED", "details": [ { "@type": "type.googleapis.com/google.rpc.ResourceInfo", "resourceType": "gae.api", "description": "The \"appengine.applications.create\" permission is required." } ] } }

We are just using the REST API calls. Request for token was successful as you can see above and the scope is ok as well. Now, when we posted the request to create application, we are having the error that says "appengine.application.create" permission required.

How do we specify the permission?

What are the possible reasons why we are getting that error? Do we missed to send a field in JSON or in query?

As per below link, we just need to pass the json containing the id and location. We also just need to pass the token in the Authorization header. The same logic I have used successfully in accessing Youtube, Drive APIs etc so not sure what needs to be done since I have followed the docs available.

I have also posted the same issue in Google Groups and now waiting for their reply.

答案1

得分: 2

看起来你没有提供关于如何设置授权请求所使用的帐户的详细信息。你需要确保你正在使用的帐户具有appengine.applications.create权限,就像错误文本中提到的那样。你可以使用Google身份和访问管理(IAM) API来完成这个操作。

(顺便说一下,我在原始线程中已经给出了这个答案,尽管你没有回复或似乎采取行动。去看看吧!这很可能是你需要的解决方案!)

英文:

It seems you've given no details about how you set up the account you're using to authorize the request. You'll need to make sure the appengine.applications.create permission is given to the account you're using, as mentioned in the error text. You can use the Google Identity and Access Management (IAM) API for this.

(by the way, I'd given this answer in the original thread, although you didn't reply or seem to take action on it. check it out! this is likely the solution you need!)

huangapple
  • 本文由 发表于 2017年3月29日 05:42:54
  • 转载请务必保留本文链接:https://go.coder-hub.com/43080487.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定