title: Getting 401 Unauthorized error on google API
body: <p>I am learning how to use Google Drive API to upload a file and I am getting this error:</p>
  
  <pre><code>"Client error: `POST https://www.googleapis.com/oauth2/v4/token` resulted in a `401 Unauthorized` response:\n{\n \"error\": \"unauthorized_client\",\n \"error_description\": \"Client is unauthorized to retrieve access tokens using this me (truncated...)\n"
  </code></pre>
  
  <p>I think this stem from a wrong configuration of my service account. When I created my service account, I didn't use Enable G Suite Domain-wide Delegation and just used the generated json key.</p>
  
  <p>Attached here is a screenshot of my IAM &amp; ADMIN <a href="https://i.stack.imgur.com/ay6ob.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ay6ob.png" alt="enter image description here"></a></p>
  
  <p>I also enabled API for google drive, so what am I missing? </p>