class documentation

class RemoteUserMiddleware(MiddlewareMixin):

Known subclasses: django.contrib.auth.middleware.PersistentRemoteUserMiddleware

View In Hierarchy

Middleware for utilizing web-server-provided authentication.

If request.user is not authenticated, then this middleware attempts to authenticate the username passed in the REMOTE_USER request header. If authentication is successful, the user is automatically logged in to persist the user in the session.

The header used is configurable and defaults to REMOTE_USER. Subclass this class and change the header attribute if you need to use a different header.

Method ​_remove​_invalid​_user Remove the current authenticated user in the request which is invalid but only if the user is authenticated via the RemoteUserBackend.
Method clean​_username Allow the backend to clean the username, if the backend defines a clean_username method.
Method process​_request Undocumented
Class Variable force​_logout​_if​_no​_header Undocumented
Class Variable header Undocumented

Inherited from MiddlewareMixin:

Async Method __acall__ Async version of __call__ that is swapped in when an async request is running.
Method __call__ Undocumented
Method __init__ Undocumented
Method __repr__ Undocumented
Method ​_async​_check If get_response is a coroutine function, turns us into async mode so a thread is not consumed during a whole request.
Class Variable async​_capable Undocumented
Class Variable sync​_capable Undocumented
Instance Variable ​_is​_coroutine Undocumented
Instance Variable get​_response Undocumented
def _remove_invalid_user(self, request):
Remove the current authenticated user in the request which is invalid but only if the user is authenticated via the RemoteUserBackend.
def clean_username(self, username, request):
Allow the backend to clean the username, if the backend defines a clean_username method.
def process_request(self, request):

Undocumented

force_logout_if_no_header: bool =
header: str =

Undocumented