# Simple JWT

A JSON Web Token authentication plugin for the Django REST Framework.

Simple JWT provides a JSON Web Token authentication backend for the Django REST Framework. It aims to cover the most common use cases of JWTs by offering a conservative set of default features. It also aims to be easily extensible in case a desired feature is not present.

## Acknowledgments

This project borrows code from the Django REST Framework as well as concepts from the implementation of another JSON web token library for the Django REST Framework, django-rest-framework-jwt. The licenses from both of those projects have been included in this repository in the “licenses” directory.

## Contents

- Getting started
  - Requirements
  - Installation
  - Cryptographic Dependencies (Optional)
  - Project Configuration
  - Usage
- Settings
  - `ACCESS_TOKEN_LIFETIME`
  - `REFRESH_TOKEN_LIFETIME`
  - `ROTATE_REFRESH_TOKENS`
  - `BLACKLIST_AFTER_ROTATION`
  - `UPDATE_LAST_LOGIN`
  - `ALGORITHM`
  - `SIGNING_KEY`
  - `VERIFYING_KEY`
  - `AUDIENCE`
  - `ISSUER`
  - `JWK_URL`
  - `LEEWAY`
  - `AUTH_HEADER_TYPES`
  - `AUTH_HEADER_NAME`
  - `USER_ID_FIELD`
  - `USER_ID_CLAIM`
  - `USER_AUTHENTICATION_RULE`
  - `AUTH_TOKEN_CLASSES`
  - `TOKEN_TYPE_CLAIM`
  - `JTI_CLAIM`
  - `TOKEN_USER_CLASS`
  - `SLIDING_TOKEN_LIFETIME`
  - `SLIDING_TOKEN_REFRESH_LIFETIME`
  - `SLIDING_TOKEN_REFRESH_EXP_CLAIM`
  - `CHECK_REVOKE_TOKEN`
  - `REVOKE_TOKEN_CLAIM`
- Customizing token claims
- Creating tokens manually
- Token types
  - Sliding tokens
- Blacklist app
- Stateless User Authentication
  - JWTStatelessUserAuthentication backend
- Development and contributing
- `drf-yasg` Integration
- rest_framework_simplejwt package
  - Submodules
  - rest_framework_simplejwt.authentication module
    - `JWTAuthentication`
    - `JWTStatelessUserAuthentication`
    - `JWTTokenUserAuthentication`
    - `default_user_authentication_rule()`
  - rest_framework_simplejwt.models module
    - `TokenUser`
  - rest_framework_simplejwt.serializers module
    - `PasswordField`
    - `TokenBlacklistSerializer`
    - `TokenObtainPairSerializer`
    - `TokenObtainSerializer`
    - `TokenObtainSlidingSerializer`
    - `TokenRefreshSerializer`
    - `TokenRefreshSlidingSerializer`
    - `TokenVerifySerializer`
  - rest_framework_simplejwt.tokens module
    - `AccessToken`
    - `BlacklistMixin`
    - `RefreshToken`
    - `SlidingToken`
    - `Token`
    - `UntypedToken`
  - rest_framework_simplejwt.utils module
    - `aware_utcnow()`
    - `datetime_from_epoch()`
    - `datetime_to_epoch()`
    - `format_lazy()`
    - `get_md5_hash_password()`
    - `make_utc()`
  - rest_framework_simplejwt.views module
    - `TokenBlacklistView`
    - `TokenObtainPairView`
    - `TokenObtainSlidingView`
    - `TokenRefreshSlidingView`
    - `TokenRefreshView`
    - `TokenVerifyView`
    - `TokenViewBase`
    - `token_blacklist()`
    - `token_obtain_pair()`
    - `token_obtain_sliding()`
    - `token_refresh()`
    - `token_refresh_sliding()`
    - `token_verify()`
  - Module contents

## Indices and tables

- Index

- Module Index