Last active
July 31, 2023 13:51
-
-
Save Elektordi/6aa5f423586c4dd0d0b744a3433da127 to your computer and use it in GitHub Desktop.
Decode jwt from command line
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 | |
token="$1" | |
if [ -z "$token" ]; then | |
read token | |
fi | |
echo $token | jq -R 'gsub("-";"+") | gsub("_";"/") | split(".") | select(length > 0) | .[0],.[1] | @base64d | fromjson' | |
echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment