-
Notifications
You must be signed in to change notification settings - Fork 304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JWTCookieAuthentication and SessionAuthentication not working together. #235
Comments
Not sure if this is the best way, but to my understanding for some reason the Login API is requesting credentials. My solution was to override the default class and remove any authentication requirements. from dj_rest_auth.views import LoginView
class Login(LoginView):
authentication_classes = [] And in the urls file # ...
urlpatterns = [
path("auth/login/", core_api.Login.as_view()),
path("auth/", include("dj_rest_auth.urls")),
]
# ... |
I found that I can get this to work only if I use DRF's Token Authentication as well:
I think Simple JWT must rely on this code to work. |
It seems this app can work with JWT Token or DRF Token Auth only. If I tried to use DRF SessionAuthentication only I got server errors.
error:
Related issue #161 |
I am still facing this problem with version 5.1.0. Any workaround? |
I am not sure why, but switching the order of these classes seem to work for now 'DEFAULT_AUTHENTICATION_CLASSES': [
'rest_framework.authentication.SessionAuthentication',
'dj_rest_auth.jwt_auth.JWTCookieAuthentication',
], |
I am using both of these authentication classes in
settings.py
file asDEFAULT_AUTHENTICATION_CLASSES
.With this setting if I use browsable API then I get this error:
The text was updated successfully, but these errors were encountered: