5

を資格を一覧表示しようとすると取得しています:GoogleがAndroidの開発APIを再生する - リストの資格を - "不足許可"

403 Forbidden                        

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

私はclient_secretsのJSONと "WithInstalledApplication" の認可を使用しています。

重要:他のリスティングは正しく動作しています(apks、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()); 

は、ご提案をいただき、ありがとうございます。

+0

私は関連する質問を見つけましたが、少し違った質問がありました。アカ​​ウントに関連付けられたメールアドレスを見て、ストアとデベロッパーコンソールに適切な権限が設定されていることを確認しましたか? https://stackoverflow.com/questions/24287429/google-play-android-developer-api-401-insufficient-permissions –

答えて

1

最後に、理由を見つけました。

原因は
必要「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" 
+0

これは私のために働いた。しかし、私は値 '{" pageInfo ":null、" resources ":null、" tokenPagination ":null、" ETag ":" asdfasdfsdf " – Danjoa

関連する問題