Skip to content

Instantly share code, notes, and snippets.

@hartwork
Last active January 5, 2020 01:11
Show Gist options
  • Save hartwork/68f14969e5277558dc0223060c0e0fb5 to your computer and use it in GitHub Desktop.
Save hartwork/68f14969e5277558dc0223060c0e0fb5 to your computer and use it in GitHub Desktop.
Decode JWT token
decode-jwt-token() { python3 -c 'import sys, json, base64; [print(json.dumps(json.loads(base64.urlsafe_b64decode(e + (len(e)%3)*"=")), indent=2)) for e in sys.argv[1].split(".")[:2]]' "$1"; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment