Google API 'Purchases.products: get' return 突然401错误

Google API 'Purchases.products: get' return 401 ERROR all of a sudden

Purchases.products: get 直到 2 周前一直运行良好。但是,它突然开始返回错误。 (我没有更改任何选项)

它仍然可以通过 POST 请求 https://accounts.google.com/o/oauth2/token 使用 (grant_type, client_id, client_secret, refresh_token) 刷新令牌,但是返回访问令牌后,403 错误发生如下。

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

这是 google 仪表板,表示 Purchases.products: get

的错误率

我找到了 the question 但它仍然无法正常工作。

------------编辑---------

我想描述更多细节。我不知道这是不是正确的方法,因为我实际上只是在修复有人做过的遗留系统。

上述过程(刷新令牌和请求购买信息)是在服务器端完成的。服务端验证APP发送的购买信息是否正确

当APP发送购买信息时,服务器端只调用HTTP请求(POST和GET),并带有预定义的属性(client_id,client_secret,grant_type).

这意味着没有任何登录过程。

此外,我使用的 client_idclient_secret 似乎是在 google-developer-console 中通过下图中的 create-credentials 创建的,但不是在注册 APP 时创建的。

------------编辑---------

我尝试使用所有者帐户重新创建 client_id。截图来自google developer console->IAM&Admin->IAM

但是还是一样的错误

"The current user has insufficient permissions to perform the requested operation."

您当前通过身份验证的用户无法再访问您尝试访问的数据。再次授予用户访问权限或使用具有访问权限的用户登录。

ClientId

如果您希望使用 Google API,您必须注册您的应用程序。当你这样做时 google 给你一个客户 ID。这会在您的应用程序运行时将其标识为 google。

正在访问用户数据

要访问私人用户数据,您必须获得数据所有者的访问权限。您的应用程序运行(由客户端 ID 表示),系统会提示用户登录 google 并授予您的应用程序访问其数据的权限。

如果用户失去对他们授予您的应用程序访问权限的数据的访问权限,您的应用程序将失去其访问权限。