3 ms·
If you want to avoid pasting tokens in online tools (right now it looks like they don't send out / record anything, but as a general practice, pasting sensitive
by eranation 6y ago
If you want to avoid pasting tokens in online tools (right now it looks like they don't send out / record anything, but as a general practice, pasting sensitive tokens in online tools is probably not the best idea)
Then this one liner in the browser console can be used for most purposes:
JSON.stringify(JSON.parse(atob(TOKENHERE.split('.')[1])), null, 2);
- csours 6y ago> JSON.stringify(JSON.parse(atob(TOKENHERE.split('.')[1])), null, 2); Non-code version for mobile users. My contribution: a bookmarklet I use to copy JWTs from my internal sites to the clipboard. Replace jwt_name with your name javascript: (function() { var textArea = document.createElement("textarea"); textArea.value = window.sessionStorage.jwt_name; document.body.appendChild(textArea); textArea.select(); document.execCommand('copy'); document.body.removeChild(textArea); })();
- afrodc_ 6y agoI found these aliases online and have found them quite useful. Requires jq. # JWT Payload. Provide the JWT as the argument e.g. jwtp "$JWT" alias jwtp="jq -R 'split(\".\") | .[1] | @base64d | fromjson' <<<" # JWT Header. Provide the JWT as the argument e.g. jwth "$JWT" alias jwth="jq -R 'split(\".\") | .[0] | @base64d | fromjson' <<<"