title: How do I get the User ID Token from a Credential object?
body: <p>I have been following <a href="https://developers.google.com/gmail/api/quickstart/java" rel="noreferrer">this</a> tutorial to include Google Sign-in support to my Desktop app. The library I'm using is <a href="https://github.com/google/google-api-java-client" rel="noreferrer">this one</a>.</p>
  
  <p>Everything works and this is the implementation of the <code>authorize()</code> method:</p>
  
  <pre><code>public Credential authorize() throws IOException {
      // Load client secrets.
      InputStream in = GoogleLogin.class.getResourceAsStream("/google/client_secret.json");
      GoogleClientSecrets clientSecrets = GoogleClientSecrets.load(JSON_FACTORY, new InputStreamReader(in));
  
      // Build flow and trigger user authorization request.
      GoogleAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow.Builder(
              HTTP_TRANSPORT, JSON_FACTORY, clientSecrets, SCOPES)
              .setDataStoreFactory(DATA_STORE_FACTORY)
              .setAccessType("offline")
              .build();
  
      Credential credential = new AuthorizationCodeInstalledApp(flow, new LocalServerReceiver()).authorize("user");
  
      System.out.println("Credentials saved to " + DATA_STORE_DIR.getAbsolutePath());
      return credential;
  }
  </code></pre>
  
  <p>However, from a <code>Credential</code> object, I can only retrieve the access token by calling <code>Credential.getAccessToken()</code>, but what I need is the <code>id token</code>. How can I retrieve the id_token from the user after it's been authenticated?</p>