#689: Honor Web server provided authentication
----------------------------------------+-----------------------------------
          Reporter:  [EMAIL PROTECTED]    |         Owner:  telenieko
            Status:  assigned           |     Milestone:           
         Component:  Core framework     |       Version:  SVN      
        Resolution:                     |      Keywords:           
             Stage:  Ready for checkin  |     Has_patch:  1        
        Needs_docs:  0                  |   Needs_tests:  0        
Needs_better_patch:  0                  |  
----------------------------------------+-----------------------------------
Old description:

> I would like to see a 2nd mod_python handler. one which takes the
> REMOTE_USER parameter passed to it and for it to use that as the user-id
> so that I can hook my app into the default intranet security system we
> use over here.
>
> here is the patch to the original to make that the case.
>
> NOTE: it creates a user-record if none exist for the user.
>
> Helios:/src/django_newadmin/django/core/handlers ianh$ diff
> modpython_apacheauth.py modpython.py
> 102,103c102
> <                 #user_id = self.session[users.SESSION_KEY]
> <                 user_id = self._req.user
> ---
> >                 user_id = self.session[users.SESSION_KEY]
> 106,117c105,106
> <                 try:
> <                     self._user =
> users.get_object(username__exact=user_id)
> <                 except (users.UserDoesNotExist):
> <                     from django.models.auth import User
> <                     import md5
> <                     import datetime
> <                     password_md5 = md5.new('fake').hexdigest()
> <                     now = datetime.datetime.now()
> <                     self._user = User(None, user_id,'','',
> user_id+'@cnet.com',password_md5,False,True,False,now,now)
> <                     self._user.save()
> <             #except (AttributeError, KeyError, ValueError,
> users.UserDoesNotExist):
> <             except (AttributeError, KeyError, ValueError):
> ---
> >                 self._user = users.get_object(pk=user_id)
> >             except (AttributeError, KeyError, ValueError,
> users.UserDoesNotExist):
> 120d108
> <

New description:

 I would like to see a 2nd mod_python handler. one which takes the
 REMOTE_USER parameter passed to it and for it to use that as the user-id
 so that I can hook my app into the default intranet security system we use
 over here.

 here is the patch to the original to make that the case.

 NOTE: it creates a user-record if none exist for the user.

 {{{
 Helios:/src/django_newadmin/django/core/handlers ianh$ diff
 modpython_apacheauth.py modpython.py
 102,103c102
 <                 #user_id = self.session[users.SESSION_KEY]
 <                 user_id = self._req.user
 ---
 >                 user_id = self.session[users.SESSION_KEY]
 106,117c105,106
 <                 try:
 <                     self._user =
 users.get_object(username__exact=user_id)
 <                 except (users.UserDoesNotExist):
 <                     from django.models.auth import User
 <                     import md5
 <                     import datetime
 <                     password_md5 = md5.new('fake').hexdigest()
 <                     now = datetime.datetime.now()
 <                     self._user = User(None, user_id,'','',
 user_id+'@cnet.com',password_md5,False,True,False,now,now)
 <                     self._user.save()
 <             #except (AttributeError, KeyError, ValueError,
 users.UserDoesNotExist):
 <             except (AttributeError, KeyError, ValueError):
 ---
 >                 self._user = users.get_object(pk=user_id)
 >             except (AttributeError, KeyError, ValueError,
 users.UserDoesNotExist):
 120d108
 <
 }}}

-- 
Ticket URL: <http://code.djangoproject.com/ticket/689#comment:42>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to