Skip to content

Instantly share code, notes, and snippets.

View ffeldhaus's full-sized avatar

Florian Feldhaus ffeldhaus

View GitHub Profile
@ffeldhaus
ffeldhaus / pre_request.js
Last active August 29, 2022 07:35 — forked from dinvlad/pre_request.js
Auto-generate Google Access and ID tokens from a Service Account key and save it in Postman
/* This script auto-generates a Google OAuth token from a Service Account key,
* and stores that token in accessToken variable in Postman.
*
* Prior to invoking it, please paste the contents of the key JSON
* into serviceAccountKey variable in a Postman environment.
*
* Then, paste the script into the "Pre-request Script" section
* of a Postman request or collection.
*
* The script will cache and reuse the token until it's within