5

Khi cố gắng để liệt kê các quyền lợi đang được nhận:Google Play Developer API Android - quyền lợi danh sách - "Thiếu Permission"

403 Forbidden                        

{ 
"code" : 403, 
"errors" : [ { 
"domain" : "global", 
"message" : "Insufficient Permission", 
"reason" : "insufficientPermissions" 
} ], 
"message" : "Insufficient Permission" 
} 

Tôi đang sử dụng "WithInstalledApplication" uỷ quyền với client_secrets json.

QUAN TRỌNG: Bất kỳ danh sách nào khác đang hoạt động chính xác (apks, inappproducts, ...). Chỉ có vấn đề này với các quyền lợi.

Tôi cũng chắc chắn rằng mã nguồn của tôi là đúng, nhưng chỉ dành riêng cho các tài liệu tham khảo:

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()); 

Cảm ơn bạn đã gợi ý của bạn.

+0

Tôi đã tìm thấy câu hỏi liên quan nhưng có câu hỏi hơi khác, bạn đã xem địa chỉ email được liên kết với tài khoản để đảm bảo bạn có quyền liên quan được đặt trong cửa hàng và bảng điều khiển dành cho nhà phát triển? Xem tại đây: https: //stackoverflow.com/questions/24287429/google-play-android-developer-api-401-insufficient-permissions –

Trả lời

1

Cuối cùng, tôi đã tìm thấy lý do.

Nguyên nhân là một phạm vi thiết lập vấn đề
cần "https://www.googleapis.com/auth/googleplay.inapp.readonly" phạm vi

tôi thấy nó từ tin nhắn trả lời của Google OAuth 2.0 sân chơi của :

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" 
+0

Điều này phù hợp với tôi. Nhưng tôi chỉ nhận giá trị rỗng là '{" pageInfo ": null," resources ": null," tokenPagination ": null," ETag ":" asdfasdfsdf ""} ' – Danjoa

Các vấn đề liên quan