title: How to properly get Access Token from logged in Google Sign In (client-side only app)?
body: <p>I am using Google Sign-In button to let user logging in with their Google Account:</p>
  
  <pre><code>    gapi.signin2.render("container-btn-google-login", {
          scope: "email profile",
          onsuccess: (user) =&gt; {
              let token = user.getAuthResponse();
              setToken(token);
  
              // How can I get the Access Token here
              // that should be the same as user.Zi.access_token?
  
              resolve(token);
          },
      });
  </code></pre>
  
  <p>I am going to call other Google APIs and do not want to use their Javascript library (I am going to use <code>fetch</code> to call their REST APIs).</p>
  
  <p>However, when I put <code>Authorization: token.id_token</code> as Header, the request is rejected. If I manually put a value that I can see from the Console (<code>user.Zi.access_token</code>), it works.</p>
  
  <p>How can I extract the <code>access_token</code> from Google API Javascript SDK? Using something cryptic and undocumented like <code>Zi</code> does not seem safe to me.</p>