title: Automate OAUTH2 authentication
body: <p>I need to authenticate to an API using OAUTH2, however, it has to be made programmatically, no user typing stuff in a browser is permitted.</p>
  
  <p>This seems like such a simple use case, but I haven't found anything online, the only thing close to it was <a href="https://stackoverflow.com/questions/30008357/oauth2-client-server-authentication-for-a-command-line-utility">this post</a>, and the only answer is "yeah, you don't want to use a web browser, but what if you do?"... This doesn't help.</p>
  
  <p>So, please, opening a web browser is not an option, I just want to know if Google provides any way to authenticate purely through code.</p>
  
  <p>Thank you!</p>