title: GoogleAuthException: Unknown (android)
body: <p>I have android, google authorization issue (similar to <a href="https://stackoverflow.com/questions/17906699/googleauthexception-unknown-while-doing-google-sso">.GoogleAuthException: Unknown while doing Google SSO.</a> - no answers):</p>
  
  <pre><code>09-29 00:04:38.328: W/System.err(15623): com.google.android.gms.auth.GoogleAuthException: Unknown
  09-29 00:04:38.328: W/System.err(15623):    at com.google.android.gms.auth.GoogleAuthUtil.getToken(Unknown Source)
  </code></pre>
  
  <p>It is reproducable when i execute the following code:</p>
  
  <pre><code>String scopesString = Scopes.PLUS_LOGIN + " " + Scopes.PLUS_PROFILE;
  String scopes = "oauth2:server:client_id:" + Consts.GOOGLE_PLUS_SERVER_CLIENT_ID + ":api_scope:" + scopesString;
  OR
  String scopes = "audience:server:client_id:" + Consts.GOOGLE_PLUS_SERVER_CLIENT_ID;
  Bundle appActivities = new Bundle();
  appActivities.putString(GoogleAuthUtil.KEY_REQUEST_VISIBLE_ACTIVITIES, "http://schemas.google.com/AddActivity http://schemas.google.com/BuyActivity");
  GoogleAuthUtil.getToken(activity,  accountName, scopes, appActivities);
  </code></pre>
  
  <p>Here are some notes:</p>
  
  <ol>
  <li>I can get access token with GoogleAuthUtil.getToken(activity,  accountName, "oauth2:" + scopesString)</li>
  <li>activity != null, client_id = 123456789.apps.googleusercontent.com, accountName is valid email (selected with account picker)</li>
  <li>accountName in <a href="http://plus.google.com/u/0/apps" rel="nofollow noreferrer">http://plus.google.com/u/0/apps</a> has a record about my project: &lt;Project Name> -------    app and purchase activity--------Your circles</li>
  <li>I have <code>android.permission.GET_ACCOUNTS</code></li>
  <li>The same exception with appActivities.putString(GoogleAuthUtil.KEY_REQUEST_VISIBLE_ACTIVITIES, "")</li>
  <li>The same exception with GoogleAuthUtil.getToken(activity,  accountName, scopes)</li>
  </ol>
  
  <p><strong>SOLVED</strong></p>
  
  <ol>
  <li>You should have 2 Client Ids: Installed App (Android) and Service one. You should use Service one here.</li>
  <li>Then you will get UserRecoverableAuthException: NeedPermission. You should handle exception</li>
  </ol>
  
  <p>i.e. like this:  </p>
  
  <pre><code>} catch (UserRecoverableAuthException e) {
  activity.startActivityForResult(e.getIntent(), REQUEST_AUTHORIZATION);
  }
  </code></pre>