title: google-api-nodejs-client / How to decode the id_token received from oauth2Client.getToken
body: <p>How to decode the id_token received from oauth2Client.getToken to get access to the JWT JSON fields email, sub, ..? Is there a function included in the google-api-nodejs-client lib?
  In <a href="https://developers.google.com/accounts/docs/OpenIDConnect" rel="nofollow">https://developers.google.com/accounts/docs/OpenIDConnect</a> in says:</p>
  
  <blockquote>
    <p>Since most API libraries combine the validation with the work of decoding the base64 and parsing the JSON, you will probably end up validating the token anyway as you access the fields in the ID token.</p>
  </blockquote>
  
  <pre><code>oauth2Client.getToken(req.query.code, function(err, tokens) {
      // how to decode tokens.id_token to get 
  });
  </code></pre>