用于 Google Play 订单验证的 Google 服务帐户权限
我正在开发一个 Azure 函数,该函数将在用户在我的移动应用程序中进行应用内购买后调用 Google Play API 来验证购买。
我在 Google Cloud Platform 上创建了一个服务帐户并将其设置为“所有者”,但到目前为止,当我尝试验证购买时,我的 Azure Functions 失败并出现以下错误:
Google.GoogleApiException: '服务 androidpublisher 抛出了一个 例外。 HttpStatusCode 未经授权。当前用户有 权限不足,无法执行请求的操作。'
因此,我转到 IAM 并编辑服务帐户以添加其他角色,但我完全不知道要添加哪些角色。
我也从 Google Play Console 尝试过 > API访问>服务帐户——见下文:
在权限下,我选择了:
- 查看财务数据、订单和取消调查回复
- 管理订单和订阅
我在“应用程序权限”和“帐户权限”选项卡下执行了此操作 - 参见下文:
知道我做错了什么或没做什么吗?正如我所提到的,我所需要的只是在我的 Azure Functions 应用程序中使用此服务帐户对 Google Play 进行 API 调用以验证购买。
I'm working on an Azure Function that will call Google Play API to verify a purchase after a user makes an in-app purchase in my mobile app.
I created a service account on Google Cloud Platform and set it as "Owner" but so far my Azure Functions is failing with the following error when I try to verify a purchase:
Google.GoogleApiException: 'The service androidpublisher has thrown an
exception. HttpStatusCode is Unauthorized. The current user has
insufficient permissions to perform the requested operation.'
So, I go to IAM and edit the service account to add additional roles but I'm TOTALLY confused about which roles to add.
I also tried it from Google Play Console > API Access > Service Accounts -- see below:
Under permissions, I selected:
- View financial data, orders, and cancellation survey responses
- Manage orders and subscriptions
I did this under both "App Permissions" and "Account Permissions" tabs -- see below:
Any idea what I'm doing wrong or not doing? As I mentioned, all I need is to use this service account in my Azure Functions app to make API calls to Google Play to verify purchases.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论