【问题标题】:The current user has insufficient permissions to perform the requested operation - Google Play Developer API当前用户没有足够的权限来执行请求的操作 - Google Play Developer API
【发布时间】:2022-01-07 10:37:24
【问题描述】:

我有一个启用了 Google Play Developer API 的 Google Dev Console 进程,并且该项目已链接到 Google Play 项目。在 Google Dev 控制台项目中,创建了一个服务帐户(我是该项目的所有者)。之后,我创建一个 json 文件密钥进行身份验证。尝试在 PHP、Google Developer API Playground 中使用 google-api-client 向我的应用程序的 In-App-Purchase 详细信息发送请求,但出现错误:“当前用户没有足够的权限执行请求的操作。”详情如下:

请求:

GET Request https://androidpublisher.googleapis.com/androidpublisher/v3/applications/{packageName}/purchases/products/{productId}/tokens/{token}?access_token={access_token}

回应

Array
(
    [error] => Array
        (
            [code] => 401
            [message] => The current user has insufficient permissions to perform the requested operation.
            [errors] => Array
                (
                    [0] => Array
                        (
                            [message] => The current user has insufficient permissions to perform the requested operation.
                            [domain] => androidpublisher
                            [reason] => permissionDenied
                        )

                )

        )

)

【问题讨论】:

    标签: php google-api google-oauth google-developers-console google-play-developer-api


    【解决方案1】:

    Method: purchases.products.get 对私人用户数据进行操作。由于这个事实,您使用 Oauth2 来授权用户并获取访问令牌。

    此方法需要用户同意以下范围

    错误信息The current user has insufficient permissions to perform the requested operation.

    表示两件事之一。

    • 您授权用户但未使用上述范围,如果您更改范围,请记住用户必须同意此范围,因此您需要确保它再次为用户弹出同意屏幕。
    • 您授权给自己的用户无权访问此信息,在这种情况下,您需要授权用户访问。

    【讨论】:

      猜你喜欢
      • 2022-01-14
      • 1970-01-01
      • 1970-01-01
      • 2016-08-26
      • 1970-01-01
      • 1970-01-01
      • 2014-01-24
      • 2016-11-03
      • 1970-01-01
      相关资源
      最近更新 更多