Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
python decode kubernetes service token (JWT Token)
# retrieve the default kubernetes service account token
kubectl get secret $(kubectl get serviceaccounts default -o jsonpath='{.secrets[0].name}') -o json|jq -r .data.token |base64 -D
# Decode it using Python (pip install PyJWT)
import jwt
var="encoded.jwt.token"
jwt.decode(var, options={"verify_signature":False})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment