title: Using a Google Service Account to access a GoogleAuth-protected site
body: <p>I have an app that is protected by google-oauth (3-legged OAuth) at the nginx-level (using <a href="https://github.com/cloudflare/nginx-google-oauth" rel="nofollow noreferrer">https://github.com/cloudflare/nginx-google-oauth</a>). As you may know, it requires the user to be logged in or manually login to a google account using the browser.</p>
  
  <p>I'd like to access this same protected app through the CLI/programatically. It's true that <code>nginx-google-oauth</code> provides some means that make it easy to do that: the <code>_token_curl</code> endpoint prints outs the headers ready to be used with <code>curl</code>. The problem though is that that token has an expiration date and to get it I need to be logged in or login manually to my google account.</p>
  
  <p>I'm wondering if I could use a Google Service Account (2-legged OAuth) to access the google-oauth-protected app? I've searched around in the documentation (<a href="https://developers.google.com/identity/protocols/OAuth2ServiceAccount" rel="nofollow noreferrer">https://developers.google.com/identity/protocols/OAuth2ServiceAccount</a>) and from what I understood, it's only meant to access Google APIs.</p>
  
  <p>Could someone shed some light on the subject? Thanks!</p>