JSON Web Tokens for Python
open sourceMITfree
PyJWT is a Python implementation of JSON Web Tokens (RFC 7519): jwt.encode() signs a payload and jwt.decode() verifies it against the algorithms you allow. It supports HMAC (HS256, HS384, HS512), RSA (RS256 to RS512 and PS256 to PS512), ECDSA (ES256, ES256K, ES384, ES512) and EdDSA (Ed25519 and Ed448), and warns about, or refuses, keys shorter than the standards' minimums.
Problems it solves
- issue and verify JWT access tokens in my Python API
- validate tokens from an identity provider in a Flask or FastAPI app
- sign tokens with RS256 so other services can verify them with a public key
Features
- encode and decode JWTs
- HMAC, RSA, RSA-PSS, ECDSA and EdDSA algorithms
- minimum key length checks
