Googleエンドポイントを作成しようとしています。私はエンドポイントサービスを作成し、Google APIエクスプロラーを通じて正常に動作していることをテストできました。私はアンドロイドクライアントを生成し、私のエンドポイントサービスを呼び出すためにtryied。私はclient_idの中にいくつかの不一致があるように見えますGLSエラー:GoogleクラウドエンドポイントのINVALID_AUDIENCE
AUDIENCE = "server:client_id:334082396285-hfn3t2g5pg0gv8fshf22kaadq9fs23e2.apps.googleusercontent.com";
credential = GoogleAccountCredential.usingAudience(this, AUDIENCE);
setAccountName(settings.getString(PREF_ACCOUNT_NAME, null));
、ここで
04-05 08:48:20.547: I/GLSUser(13505): GLS error: INVALID_AUDIENCE [email protected] audience:server:client_id:334082396285-hfn3t2g5pg0gv8fshf22kaadq9fs23e2.apps.googleusercontent.com
は私のサービスにアクセスするために使用される資格すなわちを構築するために、私のアンドロイドのJavaコードで、ログにこのエラーが表示されます。ここでは、作成した
1)は1つのAPIプロジェクトでのGoogle APIコンソールで2 client_idsは、 A)WEB_CLIENT_ID =私はリダイレクトのURI =なし& JavaScriptの起源=なしでWebアプリケーションのためのclient_idを作成し、私がやったことです。 b)ANDROID_CLIENT_ID =パッケージ名が& sha1の証明書フィンガープリントでアンドロイドアプリのclient_idを作成しました。
2)次に
04-05 08:48:20.397: D/overlay(159): Set pipe=RGB1 dpy=0; Set pipe=VG0 dpy=0;
04-05 08:48:20.547: W/GLSUser(13505): Status from wire: INVALID_AUDIENCE status: null
04-05 08:48:20.547: W/GLSUser(13505): Status from wire: INVALID_AUDIENCE status: null
04-05 08:48:20.547: I/GLSUser(13505): GLS error: INVALID_AUDIENCE [email protected] audience:server:client_id:334082396285-hfn3t2g5pg0gv8fshf22kaadq9fs23e2.apps.googleusercontent.com
04-05 08:48:20.547: W/GLSUser(13505): Status from wire: Unknown status: UNKNOWN
04-05 08:48:20.547: W/System.err(31908): com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAuthIOException
04-05 08:48:20.547: W/System.err(31908): at com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential$RequestHandler.intercept(GoogleAccountCredential.java:224)
04-05 08:48:20.547: W/System.err(31908): at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:836)
04-05 08:48:20.547: W/System.err(31908): at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:412)
04-05 08:48:20.557: W/System.err(31908): at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:345)
04-05 08:48:20.557: W/System.err(31908): at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:463)
04-05 08:48:20.557: W/System.err(31908): at com.package.appname.SetupActivity$SendResultToServerTask.doInBackground(SetupActivity.java:174)
04-05 08:48:20.557: W/System.err(31908): at com.package.appname.SetupActivity$SendResultToServerTask.doInBackground(SetupActivity.java:1)
04-05 08:48:20.557: W/System.err(31908): at android.os.AsyncTask$2.call(AsyncTask.java:287)
04-05 08:48:20.557: W/System.err(31908): at java.util.concurrent.FutureTask.run(FutureTask.java:234)
04-05 08:48:20.557: W/System.err(31908): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
04-05 08:48:20.557: W/System.err(31908): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
04-05 08:48:20.557: W/System.err(31908): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
04-05 08:48:20.557: W/System.err(31908): at java.lang.Thread.run(Thread.java:856)
04-05 08:48:20.557: W/System.err(31908): Caused by: com.google.android.gms.auth.GoogleAuthException: Unknown
04-05 08:48:20.557: W/System.err(31908): at com.google.android.gms.auth.GoogleAuthUtil.getToken(Unknown Source)
04-05 08:48:20.557: W/System.err(31908): at com.google.android.gms.auth.GoogleAuthUtil.getToken(Unknown Source)
はすでに同様のスレッドを見たことがあり、彼らは助けにはならなかった、 Google Api and android Oauth INVALID_AUDIENCE error
完全なログ@endpoints.api(name='devices',
version='v1',
description='Service to register devices',
allowed_client_ids=[ANDROID_CLIENT_ID,WEB_CLIENT_ID,endpoints.API_EXPLORER_CLIENT_ID],
audiences = [WEB_CLIENT_ID])
、Pythonで私のエンドポイントのサービスでこれらを使用しました
は私のAPIコンソールで新しいWebアプリケーションのclient_idを再生しました。アプリエンジンのバックエンドやアンドロイドのオーディエンススコープのオーディエンスで使用されます。まだ運がありません。 – plspl
Androidパッケージの名称を変更し、新しいAndroidクライアントIDを生成しました。それでも同じエラーが発生します。 – plspl
明白なエラーの原因を取り除くために、実際の生産でエンドポイントを実行し、物理的なAndroidデバイス(エミュレータではない)でテストしていますか? –