代码401,当前用户没有足够的权限执行请求的操作

发布于 2025-02-07 16:54:01 字数 2136 浏览 3 评论 0原文

我已经完成了以下操作:

  1. 创建一个GCP项目

  2. 在GCP Project中启用Google Play Android开发人员API

  3. 创建一个服务帐户并授权[服务帐户管理员]和[服务帐户用户]

  4. 为服务帐户创建JSON密钥,然后下载JSON文件以在我的后端服务器上配置

  5. 在Google Play Console中的我的后端服务器上配置,请链接我创建的GCP项目

  6. 在Google Play控制台中,链接我在Google Play游戏机中 ,启用Play Android开发人员API

  7. 赠款服务帐户财务权限

  8. 将服务帐户添加到许可测试

(请参阅Internet上的某些实践) 9。编辑应用内产品/订阅信息以更新 10。等待了一个晚上(也许更多),然后进行其他尝试,我不知道我是否需要等待。

然后,我使用后端服务器调用接口:androidPublisher.subscriptionpurchasesservice.get

我将获得401错误:具体错误如下:

{
    "msg":{
        "error":{
            "code":401,
            "message":"The current user has insufficient permissions to perform the requested operation.",
            "errors":[
                {
                    "message":"The current user has insufficient permissions to perform the requested operation.",
                    "domain":"androidpublisher",
                    "reason":"permissionDenied"
                }
            ]
        }
    }
}

以下是一些操作记录:

1。在GCP项目中创建一个服务帐户

2。创建JSON SECRET KEY

3。将Google Play控制台与GCP项目相关联

4。 Googoogle Play Console中显示的服务帐户

5。 Googoogle Play Console中的赠款服务帐户财务权限

6。将服务帐户添加到许可测试

7。使用后端服务器访问API

8。错误401,噩梦开始

I have done the following:

  1. Create a GCP project

  2. Enable Google Play Android Developer API in GCP project

  3. Create a service account and authorize [Service Account Admin] and [Service Account User]

  4. Create a json key for the service account, and download the json file to configure on my backend server

  5. In the Google Play console, link the GCP project I created

  6. In the Google Play console, enable the Play Android Developer API

  7. Grant service account financial permissions

  8. Add the service account to the licensing test

(refer to some practices on the Internet)
9. Edit in-app product/subscription information to update
10. After waiting one night (maybe more) and then doing some other attempts, I don't know if I need to wait any longer.

Then I use the backend server to call the interface: androidpublisher.SubscriptionPurchasesService.Get

I will get a 401 error: the specific error is as follows:

{
    "msg":{
        "error":{
            "code":401,
            "message":"The current user has insufficient permissions to perform the requested operation.",
            "errors":[
                {
                    "message":"The current user has insufficient permissions to perform the requested operation.",
                    "domain":"androidpublisher",
                    "reason":"permissionDenied"
                }
            ]
        }
    }
}

Here are some operational records:

1. Create a service account in a GCP project

2. create json secret key

3. Associate the Google Play console with the GCP project

4. Service account displayed in GooGoogle play console

5. Grant service account financial permissions in GooGoogle play console

6. Add service account to licensing test

7. Access the API using the backend server

8. Error 401,the nightmare begins

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

陌上芳菲 2025-02-14 16:54:01

我遇到了同样的问题,并最终解决了它:

我遵循了原始海报所采取的每一步。此外,受另一个线程的启发,我禁用并重新启用了Google Play订阅产品,等待了几分钟,并且几分钟,并且然后它起作用。希望这对您有帮助!

I encountered the same issue and eventually resolved it:

I followed every step that the original poster had taken. Additionally, inspired by another thread, I disabled and re-enabled the Google Play subscription products, waited for a few minutes, and then it worked. I hope this helps you!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文