The claims library models authenticated identity as immutable data plus optional JWT packaging.
| Type | Role |
|---|---|
Claim |
Single name/value with typed accessors (IntValue, BoolValue, …) |
ClaimSet |
Mutable builder for standard and custom JWT claims |
ClaimList |
Low-allocation list builder converted to ClaimSet |
Principal |
Immutable identity used after authentication |
ClaimSet exposes helpers for sub, iss, aud, exp, nbf, iat, jti, plus app claims like email, name, roles, and scopes.
| Signer / validator | Use case |
|---|---|
HMAC256Signer / HMAC256Validator |
Shared secret services |
RSASigner / RSAValidator |
Public-key deployments |
See JWT integration for key loading and validation patterns.
SerializePrincipal / DeserializePrincipal support message passing. Deserialized principals have limited mutability — prefer full ClaimSet reconstruction when you need custom claim writes.
- Set reasonable
expon every token - Protect HMAC secrets and RSA private keys
- Validate tokens on every request boundary
- Prefer immutable
Principalin handlers after validation