Service Account Client ID: com.google.android.gms.auth.GoogleAuthException: Unknown

I am trying to create a simple Andriod app that allows users to log in using Google+ login.

Once logged in, they can access the J2ee server URLs. As part of the J2ee server logic, I want to check if requests are coming from authentication and \ riod app.

Based on google help documentation and many other blogs, I created 2 clients (under Credentails in google developer console).

  • Client ID for Android Application
  • Service account

    private static final String scopes = "audience: server: client_id:" + SERVER_CLIENT_ID; // id from service account

    String accountName = Plus.AccountApi.getAccountName (mGoogleApiClient); Account = new account (accountName, GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE); String idToken = GoogleAuthUtil.getToken (getApplicationContext (), account, scopes);

I am getting error on the last line (GoogleAuthUtil.getToken).

com.google.android.gms.auth.GoogleAuthException: Unknown                                                                                                

      

I cannot proceed further. Am I doing something wrong here?

I see many similar questions on stackoverflow, however most of them seem to have been fixed. I've tried every suggestion. Looks like I'm doing somethi \ Wrong.

Can someone point me in the right direction.

+3


source to share





All Articles