Google Play Android开发者API-列表权利-”的;许可不足“;
尝试列出我获得的权利时:Google Play Android开发者API-列表权利-”的;许可不足“;,android,google-play-services,google-api-java-client,google-play-console,Android,Google Play Services,Google Api Java Client,Google Play Console,尝试列出我获得的权利时: 403 Forbidden { "code" : 403, "errors" : [ { "domain" : "global", "message" : "Insufficient Permission", "reason" : "insufficientPermissi
403 Forbidden
{
"code" : 403,
"errors" : [ {
"domain" : "global",
"message" : "Insufficient Permission",
"reason" : "insufficientPermissions"
} ],
"message" : "Insufficient Permission"
}
我正在对客户端使用“WithInstalledApplication”授权
重要提示:任何其他列表工作正常(APK、inappproducts等)。我只是有这个权利的问题
我也确信我的源代码是正确的,但仅供参考:
final AndroidPublisher service = AndroidPublisherHelper.init(appName, null);
final AndroidPublisher.Entitlements entitlements = service.entitlements();
EntitlementsListResponse entList = entitlements.list(pkgName).execute();
System.out.println("Entiltments: " + entList.toString());
谢谢你的建议。最后,我找到了原因 原因是范围设置问题
需要“https://www.googleapis.com/auth/googleplay.inapp.readonly“范围 我从Google OAuth 2.0游乐场的响应消息中找到了它:
HTTP/1.1 403 Forbidden
Content-length: 208
X-xss-protection: 1; mode=block
X-content-type-options: nosniff
Transfer-encoding: chunked
Expires: Mon, 01 Jan 2018 23:57:28 GMT
Vary: Origin, X-Origin
Server: GSE
-content-encoding: gzip
Cache-control: private, max-age=0
Date: Mon, 01 Jan 2018 23:57:28 GMT
X-frame-options: SAMEORIGIN
Alt-svc: hq=":443"; ma=2592000; quic=51303431; quic=51303339; quic=51303338; quic=51303337; quic=51303335,quic=":443"; ma=2592000; v="41,39,38,37,35"
Content-type: application/json; charset=UTF-8
Www-authenticate: Bearer realm="https://accounts.google.com/", error=insufficient_scope,
scope="https://www.googleapis.com/auth/googleplay.inapp.readonly"
我发现了一个相关的问题,但问题稍有不同,您是否查看了与帐户关联的电子邮件地址,以确保您在应用商店和开发控制台中设置了相关权限?看这里:这对我有用。但是我只得到null作为值
{“pageInfo”:null,“resources”:null,“tokenPagination”:null,“ETag”:“asdfasdfsdf”“}