title: Access token retrieved:null. com.google.android.gms.auth.GoogleAuthException: Unknown
body: <p>My app allows users to login with Google Plus, and gets their name, and email address. I am tried to access the token. </p>
  
  <p>Code to access the token:</p>
  
  <pre><code>Toast.makeText(this, "User is connected!", Toast.LENGTH_LONG).show();        
  GooglePlayServicesUtil.isGooglePlayServicesAvailable(getApplicationContext());
          AccountManager am = AccountManager.get(this);
  
          final Account[] accounts = am.getAccountsByType(GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE);
  
          AsyncTask&lt;Void, Void, String&gt; task2 = new AsyncTask&lt;Void, Void, String&gt;() {
              public static final int REQUEST_CODE_TOKEN_AUTH = 100;
  
              @Override
              protected String doInBackground(Void... params) {
                  String mScope="audience:server:client_id:899555500747-38rpnq51of946grhdvofck7r8u5p09cd.apps.googleusercontent.com:api_scope:https://www.googleapis.com/auth/plus.login";
  // Get the token for the current user
                  String token = null;
                  try {
                      token = GoogleAuthUtil.getToken(getApplicationContext(), Plus.AccountApi.getAccountName(mGoogleApiClient), mScope);
                      Log.i("G token", token);
                  } catch (IOException transientEx) {
                      // Network or server error, try later
                      Log.e(TAG, transientEx.toString());
                  } catch (UserRecoverableAuthException e) {
                      // Recover (with e.getIntent())
                      Log.e(TAG, e.toString());
                      Intent recover = e.getIntent();
                      startActivityForResult(recover, REQUEST_CODE_TOKEN_AUTH );
                  } catch (GoogleAuthException authEx) {
                      // The call is not ever expected to succeed
                      // assuming you have already verified that
                      // Google Play services is installed.
                      Log.e(TAG, authEx.toString());
                  }
                  return token;
              }
              @Override
              protected void onPostExecute(String token) {
                  Log.i(TAG, "Access token retrieved:" + token);
              }
  
          };
          task2.execute();
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>01-27 23:42:14.877  30994-31262/com.unicloud.mittal E/loginWithGooglePlus﹕ com.google.android.gms.auth.GoogleAuthException: Unknown
  01-27 23:42:14.877  30994-30994/com.unicloud.mittal I/loginWithGooglePlus﹕ Access token retrieved:null
  </code></pre>
  
  <p>I have tried various solutions which I could find on stackoverflow. At the moment, I am using Client ID from "Service Account" from <a href="https://console.developers.google.com/project?authuser=0" rel="noreferrer">dev console</a>, I have also tried using it for "Client ID for Android Application", it still showed the same error.</p>
  
  <p>Please let me know what am I doing wrong? Thanks.</p>