Signed content
Create and verify JWS messages and JWTs with compact or JSON serialization and explicit algorithm selection.
JOSE and JWT
Sign, encrypt, and validate standards-based JSON security objects.
joserfc is the focused home for Authlib's JOSE work. Its redesigned, typed API keeps signing, encryption, key handling, algorithms, token decoding, and claims validation explicit while following the relevant RFCs.
pip install joserfcWhat it covers
A standalone, type-hinted implementation of JWS, JWE, JWK, JWA, and JWT.
Create and verify JWS messages and JWTs with compact or JSON serialization and explicit algorithm selection.
Encrypt and decrypt JWE messages using registered key-management and content-encryption algorithms.
Import JWK material, calculate thumbprints, manage algorithms, decode tokens, and validate JWT claims separately.
Coverage
Quickstart
Install joserfc, try this focused path, then move into the project documentation for configuration, security notes, and production guidance.
from joserfc import jwt, jwk
key = jwk.import_key("your-secret-key", "oct")
encoded = jwt.encode({"alg": "HS256"}, {"sub": "user-123"}, key)
token = jwt.decode(encoded, key)
print(token.header)
print(token.claims)Project family
Migration
joserfc uses a redesigned API with explicit key objects and separate claims validation. Follow the migration guide for JWT, JWK, JWS, and JWE changes.
Read the migration guide