Skip to content

Instantly share code, notes, and snippets.

Last active Feb 12, 2018
What would you like to do?
Utils for working with GCloud service accounts


  1. Install and activate virtualenv (to avoid conflicts)
  2. Install google-oauth2l

Generate token

  1. Create a service account:

  2. Download the private key, eg my-project-123asd.json

  3. Fetch token:

     $ oauth2l fetch --json ~/Downloads/my-project-123asd.json <scope>

Use token

    $ curl -H "authorization: bearer <token>" https://<service>


    $ curl https://<service><token>

Inspect token

    $ curl<token>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment