Opened 19 years ago
Last modified 13 years ago
#689 closed enhancement
allow apache to provide authentication instead of django — at Initial Version
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Core (Other) | Version: | dev |
Severity: | normal | Keywords: | |
Cc: | telenieko@…, hozer@…, koen.biermans@…, hugh@…, ericvw@…, grf@…, hinnerk@…, me@…, zilingzhao@…, dvd@…, erik.engbrecht@…, David Larlet | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
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(usernameexact=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+'@…',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
<
Patch to existing mod_python handler