title: Google login get access token with new GoogleSignInOptions
body: <p>My android app currently uses the GoogleAuthUtil to signin users and fetch an <code>access_token</code> which is passed to the backend (code snippets below which show creating the GoogleApiClient and using GoogleAuthUtil to get the token).</p>
  
  <pre><code>mGoogleApiClient = new GoogleApiClient.Builder(this)
          .addConnectionCallbacks(this)
          .addOnConnectionFailedListener(this)
          .addApi(Plus.API)
          .addScope(new Scope("profile"))
          .build();
  ...
  ...
  
  String accessToken = GoogleAuthUtil.getToken(GoogleLoginActivity.this,
                              Plus.AccountApi.getAccountName(mGoogleApiClient),
                              "oauth2:profile email");
  </code></pre>
  
  <p>which I then sent to the backend </p>
  
  <p>I am now trying to move to the new Google SignIn - <a href="https://developers.google.com/identity/sign-in/android/sign-in" rel="noreferrer">https://developers.google.com/identity/sign-in/android/sign-in</a></p>
  
  <p>and so changed the GoogleApiClient creation like,</p>
  
  <pre><code>GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
          .requestEmail()
          .requestIdToken("&lt;web client id&gt;")
          .build();
  mGoogleApiClient = new GoogleApiClient.Builder(this)
          .enableAutoManage(this, this)
          .addApi(Auth.GOOGLE_SIGN_IN_API, gso)
          .build();
  </code></pre>
  
  <p>and then to do the login use,</p>
  
  <pre><code>startActivityForResult(Auth.GoogleSignInApi.getSignInIntent(mGoogleApiClient), RC_GET_TOKEN);
  </code></pre>
  
  <p>and on activity result use (similar to the example in the link above),</p>
  
  <pre><code>OptionalPendingResult&lt;GoogleSignInResult&gt; opr = Auth.GoogleSignInApi.silentSignIn(mGoogleApiClient);
  if (opr.isDone()) {
      // If the user's cached credentials are valid, the OptionalPendingResult will be "done"
      // and the GoogleSignInResult will be available instantly.
      Log.d(TAG, "Got cached sign-in");
      handleSignInResult(opr.get());
  } else {
      // If the user has not previously signed in on this device or the sign-in has expired,
      // this asynchronous branch will attempt to sign in the user silently.  Cross-device
      // single sign-on will occur in this branch.
      showProgress();
      opr.setResultCallback(new ResultCallback&lt;GoogleSignInResult&gt;() {
          @Override
          public void onResult(GoogleSignInResult googleSignInResult) {
              hideProgress();
              handleSignInResult(googleSignInResult);
          }
      });
  }
  </code></pre>
  
  <p>but now it seems that in <code>handleSingInResult(GoogleSignInResult result)</code> I can only get an <code>id token</code> back with
  <code>result.getSignInAccount().getIdToken();</code></p>
  
  <p>Does anyone know if it is possible to get an access token from this (like previously) and if so how? Any help appreciated.</p>