Skip to content

Instantly share code, notes, and snippets.

View DanielLaberge's full-sized avatar

Daniel Laberge DanielLaberge

  • ConstructBuy
  • Canada
View GitHub Profile
0.0.0.0 us.rdx2.lgtvsdp.com
0.0.0.0 us.info.lgsmartad.com
0.0.0.0 us.ibs.lgappstv.com
0.0.0.0 CA.ibs.lgappstv.com
0.0.0.0 us.lgtvsdp.com
0.0.0.0 ad.lgappstv.com
0.0.0.0 smartshare.lgtvsdp.com
0.0.0.0 ibis.lgappstv.com
# added after fork
@DanielLaberge
DanielLaberge / postman-pre-request.js
Last active April 3, 2024 18:58 — forked from bcnzer/postman-pre-request.js
Postman pre-request script to automatically get an id_token from AWS Cognito using a Refresh Token and save it for reuse
/* This Postman pre-request script allows using an id_token from an Amazon Cognito OAuth2 flow instead of the access_token.
It only exists as a workaround because Postman's team has been ignoring requests to let us use an id_token instead of access_token since 2014.
See: https://github.com/postmanlabs/postman-app-support/issues/8231 and https://github.com/postmanlabs/postman-app-support/issues/492
It has been adapted to support AWS Cognito User Pools from https://gist.github.com/bcnzer/073f0fc0b959928b0ca2b173230c0669#file-postman-pre-request-js-L29
It uses a refresh_token (which you must get manually) and exchanges it for an id_token, and refreshes it automatically as needed.
You could use it to talk to most OAuth2 Endpoints with very minimal changes.
How to use: