Note that there are some explanatory texts on larger screens.

plurals
  1. POEndpoints User Authentication
    primarykey
    data
    text
    <p>I'm trying to access User in one of my endpoints but can't get the magic to happen from Android. The documentation seems to be in a somewhat broken state, seeing how it is just transitioning from the trusted-tester program, and I'm seeing conflicting information, so I'm hoping someone here can help me out. </p> <p>I've created my client id for Android in the API console. I'm specifying it as a client id and audience in my endpoint like so:</p> <pre><code>@Api( name = "tictactoe", clientIds = {"myAndroidClientId.apps.googleusercontent.com"}, audiences = {"myAndroidClientId.apps.googleusercontent.com"} ) </code></pre> <p>In my Android activity, I'm creating my credential:</p> <pre><code>credential = GoogleAccountCredential.usingAudience(this, "server:client_id:myAndroidClientId.apps.googleusercontent.com"); credential.setSelectedAccountName(myAccountName); </code></pre> <p>and am using that to build my service before making a network call in an AsyncTask:</p> <pre><code>Builder builder = new MyService.Builder(transport, jsonFactory, credential); MyService service = builder.build(); thing = service.things().get().execute(); </code></pre> <p>which then throws this exception:</p> <pre><code>com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAuthIOException Caused by: com.google.android.gms.auth.GoogleAuthException: Unknown com.google.android.gms.auth.GoogleAuthUtil.getToken(Unknown Source) com.google.android.gms.auth.GoogleAuthUtil.getToken(Unknown Source) com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential.getToken(GoogleAccountCredential.java:192) com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential$RequestHandler.intercept(GoogleAccountCredential.java:217) </code></pre> <p>Thanks in advance for your help!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload