Skip to content

Instantly share code, notes, and snippets.

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
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