SessionAuthentication enforcing CSRF on @action decorator when permission_classes is overridden despite JWTAuthentication set on viewset
“Body: Environment: Django 5.x Django REST Framework djangorestframework-simplejwt React (Vite) frontend using JWT Bearer tokens Problem: I have a ModelViewSet with authentication_classes = [JWTAuthentication] set at the class level. When I add a custom @action decorator and override permission_cl...”
django-forum · Nasirsuave · 6/8/2026
Open original →Django DRF JWT Authentication credentials were not provided on UpdateAPIView even for is_staff user
“<p>I'm implementing JWT authentication using Django REST Framework and <code>djangorestframework-simplejwt</code> in my project.</p>
<p>I have an endpoint for updating a category.</p>
<p><strong>What I tried</strong></p>
<ol>
<li><p>Verified that the JWT token is valid.</p>
</li>
<li><p>Confirmed th”
stackexchange · Amirhosein Heidari · 12/23/2025
Open original →Django + SimpleJWT: Access tokens sometimes expire immediately ("credentials not provided") when calling multiple endpoints
“<p>I’m building a Vue 3 frontend (deployed on Vercel at example.com) with a Django REST Framework backend (deployed on Railway at api.example.com).</p>
<p>Authentication uses JWT access/refresh tokens stored in HttpOnly cookies (access, refresh).</p>
<p>Access token lifetime = 30 minutes</p>
<p>Refr”
stackexchange · Leonard Emmanuel · 9/11/2025
Open original →How to prevent user from modifying data through Django DRF
“<p>My API endpoints are exposed to the browser via Django DRF which I'm aware is normal. However, the primary issue with this is that someone can perform any operation my API can perform without going through my application. I have validation for my endpoints but the user could delete payment record”
stackexchange · Simeon Thomas · 5/5/2025
Open original →How to secure JWT tokens with a DRF backend supporting both mobile and SPA clients?
“<p>I am developing an application that uses the Django REST Framework to provide a REST API.</p>
<p>I intend to protect it using token authentication, with the help of <a href="https://django-rest-framework-simplejwt.readthedocs.io/en/latest/" rel="nofollow noreferrer"><code>simple_jwt</code></a>.</”
stackexchange · Slav · 2/23/2025
Open original →