@allcleardecisioning/gcloud-auth-util-server
v0.0.1
Published
A wrapper around gcloud auth for use with postman
Downloads
5
Readme
gcloud-auth-util-server
A simple server utility designed for Google Cloud authentication token management within Postman.
Installation
npm install -g @allclear-decisioning/gcloud-auth-util-server
Usage
1. Start the server
gcloud-auth-util-server
2. Set up Postman
- Open Postman
- Go to your collection > Pre-request Script
- Add the following code:
try { pm.sendRequest({ url: 'http://localhost:3333/get-token', method: 'GET', header: { 'Content-Type': 'application/json', }, }, function (err, res) { if (err) { console.error('Error generating token:', err); } else { pm.environment.set('gcloud_token', res.text()); } }); } catch (error) { console.error('Error generating token:', error); }
- Go to your collection > Authorization
- Select Bearer Token
- Set the token by using
{{gcloud_token}}
as the token value - The token will be automatically refreshed when it expires
- Enjoy!