abbadon420@sh.itjust.works to Cybersecurity@sh.itjust.worksEnglish · 2 days agoNoob question: is jwt.io safe to examine my company's tokens there?message-squaremessage-square7linkfedilinkarrow-up17arrow-down11
arrow-up16arrow-down1message-squareNoob question: is jwt.io safe to examine my company's tokens there?abbadon420@sh.itjust.works to Cybersecurity@sh.itjust.worksEnglish · 2 days agomessage-square7linkfedilink
minus-squareYourBestFriend@quokk.aulinkfedilinkEnglisharrow-up8·2 days agoNo. It’s just a dot separated array of base64 encoded strings. You don’t need any fancy debug const jwt = "PASTE_JWT_HERE"; const [header, payload] = jwt.split("."); const decode = (part) => JSON.parse( new TextDecoder().decode( Uint8Array.from( atob(part.replace(/-/g, "+").replace(/_/g, "/")), c => c.charCodeAt(0) ) ) ); console.log("Header:", decode(header)); console.log("Payload:", decode(payload));
minus-squarepcouy@lemmy.pierre-couy.frlinkfedilinkEnglisharrow-up2·2 days agoFor just the payload on bash : echo "$TOKEN" | cut -d '.' -f2 | base64 --decode | jq -C . (the last pipe and jq command can be dropped if you don’t have it installed)
minus-squareYourBestFriend@quokk.aulinkfedilinkEnglisharrow-up3·2 days agoSassy. base64 -d <<< "${TOKEN//./ }"
No. It’s just a dot separated array of base64 encoded strings. You don’t need any fancy debug
const jwt = "PASTE_JWT_HERE"; const [header, payload] = jwt.split("."); const decode = (part) => JSON.parse( new TextDecoder().decode( Uint8Array.from( atob(part.replace(/-/g, "+").replace(/_/g, "/")), c => c.charCodeAt(0) ) ) ); console.log("Header:", decode(header)); console.log("Payload:", decode(payload));For just the payload on bash :
echo "$TOKEN" | cut -d '.' -f2 | base64 --decode | jq -C .(the last pipe and jq command can be dropped if you don’t have it installed)Sassy.
base64 -d <<< "${TOKEN//./ }"