{"id":48070252,"url":"https://github.com/imankarimi/django-auth-protection","last_synced_at":"2026-04-04T14:41:09.414Z","repository":{"id":57673768,"uuid":"482228543","full_name":"imankarimi/django-auth-protection","owner":"imankarimi","description":"Django Auth Protection This package logout users from the system by changing the password in Simple JWT REST API.","archived":false,"fork":false,"pushed_at":"2022-06-01T10:55:42.000Z","size":11,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-27T17:16:21.328Z","etag":null,"topics":["authentication","django","django-rest-framework","jwt","simple-jwt"],"latest_commit_sha":null,"homepage":"https://github.com/imankarimi/django-auth-protection","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/imankarimi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-04-16T10:53:05.000Z","updated_at":"2025-03-07T17:46:39.000Z","dependencies_parsed_at":"2022-08-31T11:50:38.833Z","dependency_job_id":null,"html_url":"https://github.com/imankarimi/django-auth-protection","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/imankarimi/django-auth-protection","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imankarimi%2Fdjango-auth-protection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imankarimi%2Fdjango-auth-protection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imankarimi%2Fdjango-auth-protection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imankarimi%2Fdjango-auth-protection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imankarimi","download_url":"https://codeload.github.com/imankarimi/django-auth-protection/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imankarimi%2Fdjango-auth-protection/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31403283,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T10:20:44.708Z","status":"ssl_error","status_checked_at":"2026-04-04T10:20:06.846Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["authentication","django","django-rest-framework","jwt","simple-jwt"],"created_at":"2026-04-04T14:41:08.432Z","updated_at":"2026-04-04T14:41:09.408Z","avatar_url":"https://github.com/imankarimi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Django Auth Protection\n**Django Auth Protection** This package logout users from the system by changing the password in REST API.\n\n\u003cbr /\u003e\n\n## Why Django Auth Protection?\nSimple 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.\n\n\u003cbr\u003e\n\n## How to use it\n\n\u003cbr /\u003e\n\n* Download and install latest version of Django Auth Protection:\n\n```bash\n$ pip install django-auth-protection\n# or\n$ easy_install django-auth-protection\n```\n\nThen you have to create a custom `TokenObtainPairView` class and change the `serializer_class` to `ProtectTokenObtainPairSerializer` (follow the sample):\n\n- Make a custom `TokenObtainPairView` and change the `serializer_class`:\n```python\nfrom auth_protection.serializers import ProtectTokenObtainPairSerializer\n\n\nclass CustomTokenObtainPairView(TokenObtainPairView):\n\n    serializer_class = ProtectTokenObtainPairSerializer\n```\n\n- Change All `authentication_classes` on your views and replace it with `JWTAuthProtection`:\n```python\nfrom auth_protection.authentications import JWTAuthProtection\n\n\nclass SampleView(TARGET_VIEW):\n    authentication_classes = [JWTAuthProtection]\n```\n\n- Change your `TokenRefreshView` view to `ProtectTokenRefreshView` (EX: `urls.py`):\n```python\nfrom auth_protection.views import ProtectTokenRefreshView\n\nurlpatterns = [\n    # ...\n    path('YOUR_PATH/refresh/', ProtectTokenRefreshView.as_view(), name='URL_NAME'),\n    # ...\n]\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimankarimi%2Fdjango-auth-protection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimankarimi%2Fdjango-auth-protection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimankarimi%2Fdjango-auth-protection/lists"}