Skip to content

Home

logo

Welcome to Jam documentation!

About

Jam(Jeneric auth module) - a simple library that makes implementing authentication in your application effortless.

Installation

pip install jamlibInstalled!

How to install dev version: -> Jam Unstable

Asynchronous support

Note

You can use jam.aio module to work with async functions. The methods are the same, but you need to use await keyword.

from jam.aio import Jam

config = {
    "auth_type": "jwt",
    "alg": "HS256",
    "secret_key": "secret",
    "expire": 2600
}
jam = Jam(config=config)
payload = await jam.make_payload(**{"user_id": 1})
token = await jam.gen_jwt_token(payload)

Why Jam?

Jam is a library that provides the most popular AUTH* mechanisms right out of the box.

Framework integrations

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.

Why choose Jam?

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
Server side sessions
OTP
OAuth2
Flexible config
Modularity