I am using Django remote user authentication in a project. What I am actually using is just django.contrib.auth.RemoteUserBackend
without the middleware, and manually calling authenticate
after having checked with the backend that the user is legitimate.
Reading the source of the middleware, it seems that it just takes the username from a header in the request and then authenticates the user against the backend passing this username. The remote user backend, in turn, just merrily logs the user in with whatever username was passed. The user has then access to every area that requires a valid login.
Isn't this just a huge security flaw? How is this meant to be used?
In my case I should be safe, since the only call to authenticate
comes after a successful remote identity verification, but I am wondering the reason why the middleware was introduced.