Skip to content

Instantly share code, notes, and snippets.

@krohne
Created May 21, 2018 15:42
Show Gist options
  • Save krohne/ae01e7e74cf1ec5939d29bde79832952 to your computer and use it in GitHub Desktop.
Save krohne/ae01e7e74cf1ec5939d29bde79832952 to your computer and use it in GitHub Desktop.
Decode Base64 JWT from login request in Postman
const jsonData = JSON.parse(responseBody);
const payload = jsonData.id_token.split('.')[1]; // Assuming the JWT is in id_token
const parsed = JSON.parse(atob(payload));
pm.environment.set('user_id', parsed.user_id); // Assuming user_id is in the payload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment