class RemoteUserMiddleware(MiddlewareMixin):
Known subclasses: django.contrib.auth.middleware.PersistentRemoteUserMiddleware
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 |