Menu

What Is Actually Inside a JWT, and Why Decoding One Locally Matters
📰

What Is Actually Inside a JWT, and Why Decoding One Locally Matters

DEV Community: authentication·ToolPeko·4 days ago
#GUUNzosq
#devtoauthentication#devto#dev#token#payload
Long article (1130 words) — no AI summary yet.
Reading 0:00
15s threshold

The request comes back 401. The token sits in the Authorization header, a long string of letters and dots that looks like the one that worked an hour ago.

So you go looking for a way to read it. That search is where most JWT debugging goes wrong, because reading a token and trusting a token are two very different acts.

Three parts, two dots

A JSON Web Token is a string built from three parts joined by dots. The parts are the header, the payload, and the signature, and RFC 7519 defines the format.

Here is the demo token from jwt.io, the one used in their introduction:

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c

Enter fullscreen mode

Exit fullscreen mode

It is public sample data for a fake user named John Doe. Print it, paste it, take it apart. Nobody gets hurt.

Each part is base64url encoded.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.