Google 엔드 포인트를 얻으려고합니다. 엔드 포인트 서비스를 생성하여 Google API 익스플로러를 통해 정상적으로 작동하는지 테스트 할 수있었습니다. 그런 다음 안드로이드 클라이언트를 생성하고 내 엔드 포인트 서비스를 호출하기 위해 tryied. 나는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));
CLIENT_ID의 일부 일치하지 않는 것 같습니다,
04-05 08:48:20.547: I/GLSUser(13505): GLS error: INVALID_AUDIENCE [email protected] audience:server:client_id:334082396285-hfn3t2g5pg0gv8fshf22kaadq9fs23e2.apps.googleusercontent.com
여기 내 서비스에 액세스하는 데 사용되는 자격 증명 즉 구축을 내 안드로이드 자바 코드, 로그에서이 오류를 참조하십시오. 여기에 만든
1) 하나 개의 API 프로젝트에서 구글 API를 콘솔에서 2 client_ids이 A) WEB_CLIENT_ID = 내가 리디렉션 URI를 = 없음 & 자바 스크립트 기원 = 없음으로 웹 애플리케이션을위한 CLIENT_ID을 만들어, 내가 한 것입니다. b) ANDROID_CLIENT_ID = 패키지 이름이 & sha1 인증서 지문 인 Android 앱용 client_id를 만들었습니다.
2) 다음
이미 비슷한 스레드를 본 적이 그들은 도움이되지 않았다
@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])
전체 로그
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
내 API 콘솔에 새 웹 응용 프로그램 CLIENT_ID를 재생성 (이것은 맥에서 디렉토리, 그것은 리눅스와 윈도우에서 다르다). 앱 엔진 백엔드 에서뿐만 아니라 android 잠재 고객 범위에서도 잠재 고객에게 사용되었습니다. 아직도 운이 없다. – plspl
내 안드로이드 앱 패키지의 이름을 변경했으며 새로운 안드로이드 클라이언트 ID를 생성했습니다. 여전히 같은 오류가 발생합니다. – plspl
명백한 오류의 원인을 제거하려면 생산 환경에서 엔드 포인트를 실행하고 실제 안드로이드 장치 (에뮬레이터가 아닌)에서 테스트하고 있습니까? –