Logout users when the passwords changed in REST API
Project description
Django Auth Protection
Django Auth Protection This package logout users from the system by changing the password in REST API.
Why Django Auth Protection?
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. But one of the problems is that when the users change the password, they can continue to work on the system with the previous token until it expires. This package overrides the Simple JWT to solve this problem.
How to use it
- Download and install latest version of Django Auth Protection:
$ pip install django-auth-protection
# or
$ easy_install django-auth-protection
Then you have to create a custom TokenObtainPairView class and change the serializer_class to ProtectTokenObtainPairSerializer (follow the sample):
- Make a custom
TokenObtainPairViewand change theserializer_class:
from auth_protection.serializers import ProtectTokenObtainPairSerializer
class CustomTokenObtainPairView(TokenObtainPairView):
serializer_class = ProtectTokenObtainPairSerializer
- Change All
authentication_classeson your views and replace it withJWTAuthProtection:
from auth_protection.authentications import JWTAuthProtection
class SampleView(TARGET_VIEW):
authentication_classes = [JWTAuthProtection]
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django-auth-protection-1.0.3.tar.gz.
File metadata
- Download URL: django-auth-protection-1.0.3.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.7.1 requests/2.22.0 setuptools/58.2.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
043b489303ef495f9d84e1fc000517b92e00118449d6a79c11e0fd8c8410d201
|
|
| MD5 |
8cd9281c7ebac104162c04e1415b3f65
|
|
| BLAKE2b-256 |
a19688b3c75fc0fd2887ef7ad4033af5c6ff9fb62cf04c6b5a7be9fae4e7aa5e
|
File details
Details for the file django_auth_protection-1.0.3-py3-none-any.whl.
File metadata
- Download URL: django_auth_protection-1.0.3-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.7.1 requests/2.22.0 setuptools/58.2.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7e732c5b9fb0674fdd2b13ee363cf2cddd2e680f5895a36d9494c560b20cb6c4
|
|
| MD5 |
b6b2ade52991e1d374ef91ef4a0a7033
|
|
| BLAKE2b-256 |
0e125956203be6e5954e2e8974609384a8415622b9b810be777389968a94a73a
|