Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Django-rest-framework-simplejwt.readthedocs.io

# Django project settings.py

from datetime import timedelta
...

SIMPLE_JWT = {
    'ACCESS_TOKEN_LIFETIME': timedelta(minutes=5),
    'REFRESH_TOKEN_LIFETIME': timedelta(days=1),
    'ROTATE_REFRESH_TOKENS': False,
    'BLACKLIST_AFTER_ROTATION': False,
    'UPDATE_LAST_LOGIN': False,

    'ALGORITHM': 'HS256',
    'SIGNING_KEY': SECRET_KEY,
    'VERIFYING_KEY': None,
    'AUDIENCE': None,
    'ISSUER': None,
    'JWK_URL': None,
    'LEEWAY': 0,

    'AUTH_HEADER_TYPES': ('Bearer',),
    'AUTH_HEADER_NAME': 'HTTP_AUTHORIZATION',
    'USER_ID_FIELD': 'id',
    'USER_ID_CLAIM': 'user_id',
    'USER_AUTHENTICATION_RULE': 'rest_framework_simplejwt.authentication.default_user_authentication_rule',

    'AUTH_TOKEN_CLASSES': ('rest_framework_simplejwt.tokens.AccessToken',),
    'TOKEN_TYPE_CLAIM': 'token_type',
    'TOKEN_USER_CLASS': 'rest_framework_simplejwt.models.TokenUser',

    'JTI_CLAIM': 'jti',

    'SLIDING_TOKEN_REFRESH_EXP_CLAIM': 'refresh_exp',
    'SLIDING_TOKEN_LIFETIME': timedelta(minutes=5),
    'SLIDING_TOKEN_REFRESH_LIFETIME': timedelta(days=1),
}
Comment

PREVIOUS NEXT
Code Example
Python :: commend in .env 
Python :: calculate values in a certain percentile pandas 
Python :: how to assign key and value to hash dictionary in python 
Python :: python basic programs quadratic equation 
Python :: python iterate through lists itertools 
Python :: Using iterable unpacking operator * 
Python :: python merge file 
Python :: jupyter notebook print formatted text 
Python :: remove from list python by index 
Python :: python developer 
Python :: how a 16 mp camera looks like 
Python :: arabic text recognition from pdf using python 
Python :: double char 
Python :: sqlalchemy filter getattr 
Python :: tqdm continues afer break 
Python :: python beacon 
Python :: matlab end of array 
Python :: Seaborn boxplots shifted incorrectly along x-axis 
Python :: alpaca examples 
Python :: Only show legend of inner donut 
Python :: dont print pip jupyter 
Python :: Python Old style formatting 
Python :: WARNING: Ignoring invalid distribution -pencv-python 
Python :: json to csv python github 
Python :: Customize tick spacing 
Python :: pypy tinytag 
Python :: compresser fichier pyhton 
Python :: decorrelation of data using PCA 
Python :: HIDING AND ENCRYPTING PASSWORDS IN PYTHON USING MASKPASS MODULE 
Python :: python cheat sheets 
ADD CONTENT
Topic
Content
Source link
Name
2+3 =