JWT inspector
Decode five tokens, verify their HS256 signatures against the lab server key, and see which checks a careful API runs before trusting a claim.
- Interactive lab
- Intermediate
- 5 graded steps
- 0 of 5 solved
This lab is part of A sign-in from somewhere new.
Your goal
Your goalRun the checks a careful API makes on five tokens, and say exactly why each bad one is refused.
The API at api.contoso.example received five bearer tokens. Decode each one, then run the checks the API performs before it trusts a single claim.
The lab server signs with HS256 and a shared key, and its clock is fixed at 2026-03-14T09:00:00Z. You can edit any token in the box to see which check breaks.
What’s on screen
- Captured tokens
- the five buttons on the left. Each loads one token into the box.
- Lab clock and Accepted values
- under the buttons: the fixed “now” for this lab and the values the API expects.
- Encoded box
- the token text, which you can edit. Under it the three parts are coloured: header, payload, signature.
- Server checks
- six checks the API runs, each pass or fail, and the final Accepted or Rejected line.
- Walkthrough
- the numbered path beside the workbench (below it on a phone). Each step says what to do and what you should see. Hints open one at a time.
Words to know
- JWT
- JSON Web Token, a signed login token
- API
- application programming interface, how programs talk to a service
- UTC
- Coordinated Universal Time, the time zone logs use so times line up
Captured tokens
Lab clock
2026-03-14T09:00:00Z
Accepted values
alg HS256
iss https://auth.contoso.example
aud api.contoso.example
Header
{
"alg": "HS256",
"typ": "JWT"
}Payload
{
"iss": "https://auth.contoso.example",
"aud": "api.contoso.example",
"iat": "1773478200 (2026-03-14T08:50:00Z)",
"exp": "1773481800 (2026-03-14T09:50:00Z)",
"sub": "u-1042",
"name": "Ana Ruiz",
"role": "analyst"
}Server checks
- passAlgorithm is HS256 (the only one this API accepts)alg is "HS256"
- passSignature matches the server keyHMAC-SHA256 matches
- passIssuer is https://auth.contoso.exampleiss is "https://auth.contoso.example"
- passAudience is api.contoso.exampleaud is "api.contoso.example"
- passToken has not expiredexp is 2026-03-14T09:50:00Z
- passToken is already valid (nbf)no nbf claim
Accepted. The API trusts sub u-1042 with role analyst.
More in Web and API security
The whole walkthrough
Every step in order: 289 words, about 2 min. It gives away every answer, so try the steps first.