PyJWT implements RFC 7519 JSON Web Tokens in Python. Applications encode claims with chosen algorithms and verify or decode tokens with shared or asymmetric keys.
Overview
PyJWT provides encode and decode helpers for JSON Web Tokens used in authentication and delegated authorization flows. Supported algorithms include symmetric-key, RSA, ECDSA, and EdDSA families covered in the project guides.
The API accepts payload dictionaries, secrets or keys, and algorithm identifiers, returning compact serialized tokens or parsed claim sets. Optional cryptographic dependencies extend algorithm coverage beyond the base install.
Validation options, registered claim handling, JWKS client usage, and OIDC-oriented examples are covered in the guides. The package installs via pip and integrates into web frameworks and custom services that issue or verify bearer tokens.
PyJWT is maintained as a focused library rather than a standalone identity server; hosting and policy remain application responsibilities.
Key features
- JWT encode and decode
- Multiple signing algorithms
- Optional cryptographic backends
- Registered claim helpers
- JWKS client support
- Documented OIDC examples
- pip-installable package
- Key length validation options
Use cases
- API bearer token verification
- Issuing signed session tokens
- Service-to-service auth claims
- OIDC-style login integrations