Pass value to authentication class? #1288
danielniccoli
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I implemented basic authentication, where I take the username and password and do an authentication check against the Django user model. Now I have two API endpoints where I am checking if the user has a certain permission, if not I throw an
AuthenticationError
.This is how it works:
The problem I am facing now is that I want to check the permissions at the time I do the basic authentication, not afterwards. Is there any way to pass an additional parameter to the BasicAuth class, so I can do some more extensive checks per endpoint, without having to create multiple classes? Like so, for example?
Beta Was this translation helpful? Give feedback.
All reactions