From 86ffd877b4bd69d7cafb4f7465b91376f3785f18 Mon Sep 17 00:00:00 2001 From: Phil Date: Tue, 7 Jan 2025 10:16:37 -0700 Subject: [PATCH] add quick and dirty token validator --- tools/decode_token.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 tools/decode_token.py diff --git a/tools/decode_token.py b/tools/decode_token.py new file mode 100644 index 0000000..f68bb8c --- /dev/null +++ b/tools/decode_token.py @@ -0,0 +1,16 @@ +import jwt +import sys + +if len(sys.argv) != 2: + print("Usage: python decode_jwt.py ") + sys.exit(1) + +token = sys.argv[1] + +try: + # Decode the token without verifying the signature + decoded = jwt.decode(token, options={"verify_signature": False}) + print("Decoded JWT:") + print(decoded) +except jwt.DecodeError as e: + print(f"Failed to decode JWT: {e}")