Skip to content

Instantly share code, notes, and snippets.

@JekRock
Created March 19, 2025 14:21
Show Gist options
  • Save JekRock/4fd0fc1aed3d44dde8c52734a5a40916 to your computer and use it in GitHub Desktop.
Save JekRock/4fd0fc1aed3d44dde8c52734a5a40916 to your computer and use it in GitHub Desktop.
jwt-decode
# https://www.pgrs.net/2022/06/02/simple-command-line-function-to-decode-jwts/
jwt-decode() {
jq -R 'split(".") |.[0:2] | map(gsub("-"; "+") | gsub("_"; "/") | gsub("%3D"; "=") | @base64d) | map(fromjson)' <<< $1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment