Adding support for RemoteUserBackend in djblets webapi for authentication

Review Request #1682 — Created June 25, 2010 and discarded

kpeng
Djblets
djblets
The JSON API that got introduced with RB 1.5 does not recognize when we are using RemoteUserMiddleware in Django.  The djblets webapi authentication understands that we're using the RemoteUserBackend, but does not extract the relevant information or supply the correct parameter to authenticate(...).  This causes tools like post-review to fail when attempting to commit a patch to a RB instance that is running on a server with a separate authentication module.

My fix is to have the authentication functions check for the existence of the REMOTE_USER header and handle it appropriately if it exists.  The solution is a bit ugly and one-off, so I'd appreciate any feedback on how to make it more universal.
Manual, using the Kerberos authentication module for Apache and enabling 'django.contrib.auth.middleware.RemoteUserMiddleware' in settings.py.
chipx86
  1. Given the requirement for RemoteUserMiddleware, this won't work out of the box for Review Board users. I don't really have a great solution to this except to go through and hook things up the way we do auth backends in Review Board. That would be a separate change, though.
  2. djblets/webapi/auth.py (Diff revision 1)
     
     
     
    Seems to me that, if we authenticate with the user above, we'll never set realm, so we'll never actually succeed in logging in.
  3. 
      
Loading...