- Documentation: jam.makridenko.ru
- Changelog: CHANGELOG.md
pip install jamlibfrom jam import Jam
jam = Jam(config="config.toml")
jwt = jam.jwt_create({"user": 1})
session_id = jam.session_create(session_key="username", data={"user": 1})
otp_code = jam.otp_code(secret="3DB7FOAOFBCI3WFDRE7EPF43CA")Jam is a library that provides the most popular AUTH* mechanisms right out of the box.
Jam provides ready-to-use integrations for the most popular frameworks:
Each integration offers built-in middleware or plugin support for JWT and session-based authentication.
Jam supports many authentication methods out of the box with minimal dependencies. Here is a comparison with other libraries:
| Features / Library | Jam | Authx | PyJWT | AuthLib | OTP Auth |
|---|---|---|---|---|---|
| JWT | ✅ | ✅ | ✅ | ✅ | ❌ |
| JWT black/white lists | ✅ | ❌ | ❌ | ❌ | ❌ |
| PASETO | ✅ | ❌ | ❌ | ❌ | ❌ |
| Server side sessions | ✅ | ✅ | ❌ | ❌ | ❌ |
| OTP | ✅ | ❌ | ❌ | ❌ | ✅ |
| OAuth2 | ✅ | ✅ | ❌ | ✅ | ❌ |
| Flexible config | ✅ | ❌ | ❌ | ❌ | ❌ |
| Modularity | ✅ | ❌ | ❌ | ❌ | ❌ |
