android - INVALID_AUDIENCE error with Google OAuth 2.0 API -


i following tutorial auth tokens.

i have both of client_ids web server , android device set getting invalid_audience error. believe because have not generated , signed apk, instead in development.

is there special need test auth on device via usb?

i'll go through how set client_ids.

web server

this easy needed url.

android

this 1 little harder. generated apk certificate (the .jks file). cd jdk/bin dir , ran

keytool -exportcert -alias occucard -keystore "c:\users\shane\androidappkeys\occucard/occucard.jks" -v -list 

as tutorial instructs. think may problem. since development generated apk , not signed key.

side note: scope token required googleauthutils looks like:

"audience:server:client_id:" + server_client_id 

my solution create third client_id debug.keystore sha1 key. ran command

keytool -list -alias androiddebugkey -keystore "c:\users\shane\.android/debug.keystore" -storepass android -keypass android 

this allowed me use client_id in development mode.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -