Skip to main content

Welcome to JWT Allauth

JWT Allauth delivers SIMPLE authentication for the Django REST module, based on robust frameworks configured in an efficient and stateless way through JWT access/refresh token architecture. The token whitelisting system ensures granular control over user sessions while maintaining minimal database overhead.

With JWT Allauth, gain peace of mind through enterprise-grade security while dedicating your energy to building your app's unique value proposition.

Features

  • Low database load: Designed to minimize database queries through stateless JWT token authentication.
  • Token whitelisting system: Implements a refresh token whitelist tied to specific device sessions.
  • Enhanced security: Enables revoking access to specific devices or all devices simultaneously.
  • Automatic token renewal: Active sessions for extended periods without reauthentication, ideal for mobile apps.
  • Email verification: Includes a full REST email verification system during user registration.
  • Comprehensive user management: Features password recovery, email-based authentication, and session logout.
  • Effortless setup: Get your project up and running with a single command.

Why whitelisting?

The refresh token whitelist tracks devices authorized by the user, stored in the database to verify refresh tokens during access token renewal requests.

This system empowers users to revoke access to stolen/lost devices or log out of all sessions simultaneously. Refresh tokens are regenerated upon each use, ensuring active session tracking. If a refresh token is reused, the system invalidates both tokens and terminates the session tied to the compromised device.

Refresh token auto-renewal enables extended active sessions without repeated logins—ideal for mobile apps, where users shouldn’t need to reauthenticate every time they open the app.

Access tokens provide short-lived authentication credentials (via JWT), enabling stateless API access. This approach minimizes database load by eliminating per-request database queries.

Quick Start

Install using pip...

pip install django-jwt-allauth

You can quickly start a new Django project with JWT Allauth pre-configured using the startproject command:

jwt-allauth startproject myproject

This will create a new Django project called myproject with JWT Allauth pre-configured. Then:

cd myproject
python manage.py makemigrations
python manage.py migrate
python manage.py runserver

Available options:

  • --email=True - Enables email configuration in the project
  • --template=PATH - Uses a custom template directory for project creation

Email verification

To enable the email verification, configure the email provider in your settings.py file.

EMAIL_VERIFICATION = True
EMAIL_HOST = ...
EMAIL_PORT = ...
EMAIL_HOST_USER = ...
EMAIL_HOST_PASSWORD = ...
EMAIL_USE_TLS = ...
DEFAULT_FROM_EMAIL = ...

Redirection URLs

The relative url to be redirected once the email verified can be configured through:

EMAIL_VERIFIED_REDIRECT = ...

The relative url with the form to set the new password on password reset:

PASSWORD_RESET_REDIRECT = ...

If not configured, users will be redirected to the default password reset form at /jwt-allauth/password/reset/default/. This form provides a modern, responsive interface for password reset with proper form validation and error handling.

Templates

The templates can be configured in a JWT_ALLAUTH_TEMPLATES dictionary:

- ``PASS_RESET_SUBJECT`` - subject of the password reset email (default: ``email/password/reset_email_subject.txt``).
- ``PASS_RESET_EMAIL`` - template of the password reset email (default: ``email/password/reset_email_message.html``).
- ``EMAIL_VERIFICATION_SUBJECT`` - subject of the signup email verification sent (default: ``email/signup/email_subject.txt``).
- ``EMAIL_VERIFICATION`` - template of the signup email verification sent (default: ``email/signup/email_message.html``).

Example:

JWT_ALLAUTH_TEMPLATES = {
    'PASS_RESET_SUBJECT': 'mysite/templates/password_reset_subject.txt',
    ...
}

Acknowledgements

This project began as a fork of django-rest-auth. Thanks to the authors for their great work.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_jwt_allauth-1.3.1.tar.gz (89.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_jwt_allauth-1.3.1-py3-none-any.whl (127.1 kB view details)

Uploaded Python 3

File details

Details for the file django_jwt_allauth-1.3.1.tar.gz.

File metadata

  • Download URL: django_jwt_allauth-1.3.1.tar.gz
  • Upload date:
  • Size: 89.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for django_jwt_allauth-1.3.1.tar.gz
Algorithm Hash digest
SHA256 d1385300ea2cd1b24e8f2785a42690aa2d48e40c619d8fae0874dc3827ba93a8
MD5 c08cfc087f1f1abf040a2e4b75e35580
BLAKE2b-256 c0202796d7bdc234247a9f7a6aaa4cb7de1e4fcfe129270f220b656a632212dc

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_jwt_allauth-1.3.1.tar.gz:

Publisher: publish.yml on castellanos-dev/jwt-allauth

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file django_jwt_allauth-1.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for django_jwt_allauth-1.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 673f0a1fc0480bd67a1f438e8184efa30667608a62b72b2d5ddbffe87c2e03c9
MD5 0094a9fbf3f7e1fea35d380a8e8d375a
BLAKE2b-256 b558d5e2cb933f28b168b0af0ca3569a34c6f1480cbcb1ee6d82562443fb029f

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_jwt_allauth-1.3.1-py3-none-any.whl:

Publisher: publish.yml on castellanos-dev/jwt-allauth

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

1.5.1

2 files

1.5.0

2 files

1.4.1

2 files

1.4.0

2 files

This release

1.3.1 This release

2 files

1.3.0

2 files

1.2.6

2 files

1.2.5

2 files

1.2.4

2 files

1.2.3

2 files

1.2.2

2 files

1.2.1

2 files

1.2.0

2 files

1.1.1

2 files

1.1.0

2 files

1.0.3

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page