513: Improvements for authentication using REMOTE_USER

xaviour.*********@gmai***** (Google Code) (Is this you? Claim this profile.)
Feb. 4, 2014
Django is in the process of adding support for web server provided
authentication (http://code.djangoproject.com/ticket/689).

A Reviewboard server running with this enhancement does not need to present
"login", "logout" and password change dialogs which do not work and confuse
the users.

The attached patch attempts to make deploying Reviewboard with web server
provided authentication easier.
Index: settings.py
===================================================================
--- settings.py	(revision 1385)
+++ settings.py	(working copy)
@@ -42,6 +42,8 @@
     'django.middleware.locale.LocaleMiddleware',
     'django.contrib.sessions.middleware.SessionMiddleware',
     'django.contrib.auth.middleware.AuthenticationMiddleware',
+# The following line can be uncommented once Django ticket #689 is resolved
+#    'django.contrib.auth.middleware.RemoteUserAuthMiddleware',
 )
 
 TEMPLATE_CONTEXT_PROCESSORS = (
@@ -54,6 +56,13 @@
     'djblets.util.context_processors.siteRoot',
 )
 
+# Uncomment the following lines if you wish to use the authentication
+# provided by the web server.
+#AUTHENTICATION_BACKENDS = ( 
+#    'django.contrib.auth.backends.RemoteUserAuthBackend',
+#)
+#REMOTE_USER_AUTH_AUTO_CREATE = True
+
 SITE_ROOT_URLCONF = 'reviewboard.urls'
 ROOT_URLCONF = 'djblets.util.rooturl'
 
@@ -101,6 +110,7 @@
 # reviewboard in to an existing authentication environment (such 
chipx86
#1 chipx86
Can you put this up on Review Board for a review?
  • -Type-Defect
    +Type-Enhancement
    +Component-Accounts
#2 xaviour.*********@gmai***** (Google Code) (Is this you? Claim this profile.)
Done. http://reviews.review-board.org/r/412/
#3 xaviour.*********@gmai***** (Google Code) (Is this you? Claim this profile.)
Added a new patch, this time to improve "post-review".
http://reviews.review-board.org/r/415/
  • +
    Index: contrib/tools/post-review
    ===================================================================
    --- contrib/tools/post-review	(revision 1385)
    +++ contrib/tools/post-review	(working copy)
    @@ -160,23 +160,33 @@
             if self.has_valid_cookie():
                 return
     
    -        print "==> Review Board Login Required"
    -        print "Enter username and password for Review Board at %s" % self.url
    -        username = raw_input('Username: ')
    -        password = getpass.getpass('Password: ')
     
    -        debug('Logging in with username "%s"' % username)
    +        webauth = True
             try:
    -            self.api_post('api/json/accounts/login/', {
    -                'username': username,
    -                'password': password,
    -            })
    +            # There should be a specific page on the server to detect if webauth is used
    +            # Something like api/json/webauth instead of this ugly hack
    +            self.api_post('api/json/reviewrequests/1/')
             except APIError, e:
    -     
chipx86
#4 chipx86
  • +Confirmed
  • +Milestone-Release1.1
#5 asch*****@gmai***** (Google Code) (Is this you? Claim this profile.)
Any word on when this will enter the source tree?
chipx86
#6 chipx86
Pretty soon. Next couple weeks I imagine. I'm on vacation at the moment, so I'm
limiting the work I'm doing to critical things for now.
chipx86
#7 chipx86
  • +Milestone-Release1.5
chipx86
#8 chipx86
Pushing back to 1.6.
  • +Milestone-Release1.6
chipx86
#9 chipx86
  • +Milestone-Release1.6.x
#10 mra***@rapitasy********* (Google Code) (Is this you? Claim this profile.)
Is there any update on this?
david
#11 david
The patches that were initially written for this are very, very old and no longer work. If someone wants this, we'll need them to create a new patch to do it.
david
#12 david
  • -Milestone-Release1.6.x
david
#13 david
  • -Confirmed
    +WontFix