Created
April 12, 2024 06:15
-
-
Save Ajnasz/fe28b3e51c39be042f040934f6d4efae to your computer and use it in GitHub Desktop.
jwt decode shell script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Decode JWT token | |
# Usage: echo <jwt_token> | jwtdecode | |
# requires jq and base64 | |
while read input; do | |
echo $input | cut -d . -f 1,2 | tr '.' '\n' | \ | |
while read str;do | |
echo "$str"==== | fold -w 4 | sed '$ d' | tr -d '\n' | base64 --decode | jq | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment