Skip to content

DRF Viewset authentication class is not working properly #8378

Answered by JaisPiyush
JaisPiyush asked this question in General
Discussion options

You must be logged in to vote

After going through documentation and source code of DRF, I understood it's an architecture decision. Authentication class will traverse through the authentication_classes list until it receive expected (user, auth) tuple, and will stop traversal immediately after the first auth class providing such values.

Instead like permission_classes which works like perm_class_A && perm_class_B && perm_class_C. Auth classes works like
auth_class_A || auth_class_B || auth_class_C

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by JaisPiyush
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant