title: How to access admin.directory.group via OAuth2 in a cron job?
body: <p>I am trying (and failing) to use OAuth2 to make calls to the admin.directory.group scope via a command line script. I tried configuring a Service Account to do this, but get this error message:</p>
  
  <blockquote>
    <p>Error calling GET <a href="https://www.googleapis.com/admin/directory/v1/groups/foo%40example.com" rel="nofollow">https://www.googleapis.com/admin/directory/v1/groups/foo%40example.com</a>: (403) Not Authorized to access this resource/api</p>
  </blockquote>
  
  <p>I also tried using an "Installed" application type, taking the manual step of obtaining an authorization code and subsequently a refresh token, but got the same <code>Not Authorized</code> error.</p>
  
  <p>I do have "Enable API access" checked, and also have "Admin SDK" enabled in my project (though oddly it doesn't list <code>admin.directory.group</code> as one of Admin SDK's scopes).</p>
  
  <p>What am I doing wrong?</p>