Add the service-to-service module
This commit is contained in:
12
service-to-service/scripts/claims.sh
Executable file
12
service-to-service/scripts/claims.sh
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
# Print the header and payload of a JWT without verifying it. For reading, not for trusting.
|
||||
#
|
||||
# ./scripts/claims.sh "$TOKEN"
|
||||
set -eu
|
||||
python3 - "$1" <<'PY'
|
||||
import base64, json, sys
|
||||
token = sys.argv[1]
|
||||
for part in token.split('.')[:2]:
|
||||
padded = part + '=' * (-len(part) % 4)
|
||||
print(json.dumps(json.loads(base64.urlsafe_b64decode(padded)), indent=2, sort_keys=True))
|
||||
PY
|
||||
Reference in New Issue
Block a user