BACK TO TOPICS
Advanced

JWT Security

1. Anatomy of a JWT

JSON Web Token (JWT) is a compact, URL-safe means of representing claims to be transferred between two parties.

Structure

Header.Payload.Signature

  • Header: Algorithm and token type. {"alg": "HS256", "typ": "JWT"}
  • Payload: Claims (data). {"sub": "123", "admin": true}
  • Signature: HMACSHA256(base64UrlEncode(header) + "." + base64UrlEncode(payload), secret)

Module Progress

1Anatomy of a JWT
2The 'None' Algorithm Attack
3Key Confusion Attack
4Weak Secrets
5Best Practices
Progress20%