-
-
Notifications
You must be signed in to change notification settings - Fork 221
Open
Description
I am having problems setting the default rest framework authentication class to knox.auth.TokenAuthentication. It seems that in the views I have to explicitly set authentication_classes = (TokenAuthentication,):
settings.y
REST_FRAMEWORK = {
# This is not having an effect at all.
"DEFAULT_AUTHENTICATION_CLASSES": ("knox.auth.TokenAuthentication",)
}views.py
from knox.auth import TokenAuthentication
class UserProfileView(generics.RetrieveUpdateAPIView):
serializer_class = UserProfileSerializer
authentication_classes = (TokenAuthentication,) # It won't work without this line
permission_classes = (permissions.IsAuthenticated,)
def get_object(self):
return self.request.userAnd if I comment authentication_classes = (TokenAuthentication,) I get:
{
"detail": "Authentication credentials were not provided."
}
I may be missing something, but I can't figure it out. Thank you!
Metadata
Metadata
Assignees
Labels
No labels