The 7 Registered Claims in Detail
• **iss (Issuer)**: Case-sensitive string or URI identifying who created the token.
• **sub (Subject)**: The principal being asserted (e.g., user ID `usr_123`). Must be locally or globally unique.
• **aud (Audience)**: The intended consumer. Can be a string or array of strings. Verifiers must reject tokens if they are not in the aud list.
• **exp (Expiration Time)**: Integer Unix timestamp (seconds). Token is invalid after this instant.
• **nbf (Not Before)**: Integer Unix timestamp. Token cannot be accepted before this instant.
• **iat (Issued At)**: Integer Unix timestamp recording token creation time.
• **jti (JWT ID)**: Unique identifier for the token, used to track token revocation or prevent replay attacks.
Frequently Asked Questions
Are timestamp claims in milliseconds or seconds?
Seconds! RFC 7519 defines NumericDate as seconds since Unix Epoch (1970-01-01T00:00:00Z). Passing JavaScript milliseconds (Date.now()) is a very common bug.