Closed duffn closed 6 months ago
This is user error. It is actually working. I was trying with various functions that simply did not get called in my testing flow. Do something like the below and it clearly works.
def validate_bearer_token(self, token, scopes, request):
return False
My question is very similar to https://github.com/jazzband/django-oauth-toolkit/issues/1167, but I still don't know the solution.
django-oauth-toolkit
2.3.0django
4.2.11I have a custom validator:
Per the docs, I have added to my settings:
My endpoint/viewset
OAuth authentication seems to work fine, however, my custom validator is not called. There are no print statements.
If I change the class to an invalid one, I do get an error, so it is attempting to load it and I believe the path is correct (I'm also using a similar path for other packages' settings), but it does not get called.
I can even put some print statements in the library itself and see my custom class seemingly being loaded:
However, I don't see the print statements in my custom class itself. What piece am I missing?