【发布时间】:2020-08-02 17:42:43
【问题描述】:
Google Vision API 访问我的存储桶文件时遇到以下问题。
步骤:
- Server to Server OAuth2 with service account for file uploads --> 范围是https://www.googleapis.com/auth/devstorage.read_write
- 正在将文件上传到我的存储桶(没有激活 ACL,已激活公共访问以进行测试)--> 文件上传成功
- Server to Server OAuth2 with service account for Vision processing --> 范围是https://www.googleapis.com/auth/cloud-vision和https://www.googleapis.com/auth/devstorage.read_write
- 开始视觉工作 (https://eu-vision.googleapis.com/v1/files:asyncBatchAnnotate)
回复:
- 403
- 打开文件时出错:gs://mybucketname/myfile.tif
- PERMISSION_DENIED
两个 OAuth2 请求的服务帐户相同。 两个 OAuth2 请求均成功并返回 AccessToken。 视觉 API 已激活。
任何想法是什么问题?
最好的问候!
【问题讨论】:
-
你有没有想过这个问题?我遇到了同样的问题,只能通过使用云平台范围来解决。只有 cloud-vision 和 devstorage.read_write 它仍然缺少一些东西,我不确定是什么。
-
嗨,谢谢 - 这解决了我的问题!添加范围googleapis.com/auth/cloud-platform(跨谷歌云平台服务查看和管理您的数据)是“诀窍”。我认为这是为了管理而不是为了处理。
-
...不幸的是,到目前为止我还没有找到任何其他解决方案。即使在各地多次向 Google 提出请求后,也没有任何支持或建议的解决方案。
-
如果您愿意,欢迎发表您的评论作为解决方案。那么我会很乐意接受它。
标签: api access-denied google-cloud-vision bucket