Support authentication for django-rest-framework
See original GitHub issueHello! django-rest-framework uses its own authentication system, so calling set_user or get(url, user=...) has no effect for drf views that need authentication.
I am writing a custom drf auth backend that will work with the WEBTEST_USER header, and configure my settings manually to have it used. Would you be interested in that class + an option to make WebTestMixin patch it in automatically?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:21 (17 by maintainers)
Top Results From Across the Web
Authentication - Django REST framework
Authentication is the mechanism of associating an incoming request with a set of identifying credentials, such as the user the request came from, ......
Read more >Django Rest Framework authentication: the easy way
In this tutorial you'll learn how to implement Django Rest Framework authentication in your web application by leveraging the built-in ...
Read more >How to Implement Token Authentication using Django REST ...
In this tutorial you are going to learn how to implement Token-based authentication using Django REST Framework (DRF).
Read more >User Authentication with the Django Rest Framework and ...
In this tutorial, we'll build a user authentication system for a web application with Django, the Django Rest Framework (DRF), and Angular.
Read more >Token Based Authentication for Django Rest Framework
Token Based Authentication for Django Rest Framework. Django is of the popular web development framework based on python having a large community and...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Yep, it worked!
DRF is adding support for authn based on REMOTE_USER, which will make my small class obsolete: https://github.com/encode/django-rest-framework/pull/5306/files
Do you think there is value in adding my code to the docs in the meantime, or should we just close this ticket?
*edit* I forgot that this module uses WEBTEST_USER, not REMOTE_USER, so something is still needed.
*2nd edit* That something will probably be:
+ settings for django auth backend and drf auth backend.