Thanks for the quick reply,
I have installed mod_auth_sspi (1.0.4) by copying the module to the
Apache /modules directory and the sspipkgs.exe to the apache /bin
directory and adding LoadModule sspi_auth_module modules/
mod_auth_sspi.so to my https.conf
Next i added the extras to the Location tag, so it now reads as
follows:
<Location "/Django/">
AuthName "MAVERICK"
AuthType SSPI
SSPIAuth On
SSPIAuthoritative On
SSPIDomain "MAVERICK"
SSPIOmitDomain On
SSPIUsernameCase "upper"
SSPIPerRequestAuth On
Require valid-user
SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE mysite.settings
PythonOption django.root /mysite
PythonDebug On
PythonPath "['E:/Program Files/Apache Software Foundation/
Apache2.2/Django/','E:/Program Files/Apache Software Foundation/
Apache2.2/Django/mysite/'] + sys.path"
</Location>
I then added the two new classed as per ticket #689 to \django\contrib
\auth\backends.py and middleware.py
I then ammended my application settings.py:
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.middleware.doc.XViewMiddleware',
'django.contrib.auth.middleware.RemoteUserAuthMiddleware', #RDC
added as per ticket #689 and
http://groups.google.com/group/django-users/browse_thread/thread/956a3fbb9ee821cd
)
AUTHENTICATION_BACKENDS = ( #RDC added as per ticket #689 and
http://groups.google.com/group/django-users/browse_thread/thread/956a3fbb9ee821cd
'django.contrib.auth.backends.RemoteUserAuthBackend',
)
then i added the following to urls.py for testing:
(r'^Django/mysite/(.*)', 'mysite.item_inventory.views.test'),
and finally, views.py is:
from django.http import HttpResponse
def test(request, blah):
return HttpResponse("Hello, world. You're at the item_inventory
index. --" + str(request) + "--#--" + str(blah) + "--")
I restarted Apache and opened up the only session of IE 7:
- IE7 prompts me for login - as i am on an XP workstation that is not
part of a domain, i log in as MAVERICK\rui with my XP password. Not
sure why it prompts but...
- It successfully takes me to the view without any further login and
the request headers include:
'HTTP_AUTHORIZATION': 'NTLM
'REMOTE_USER': 'RUI'
So looks to be mostly working -:
1. is there anyway to get it to not prompt me for login/pwd as per IIS
webpage request (i have been using Apache and mod_auth_sspi for the
grand total of one day - and Django for only a few days longer so this
could explain my ignorance)?
2. the test method i defined above needed a second parameter, but i
have no idea why and it was blank upon running str(blah), any ideas?
3. running the contrib.admin pages, it still asks me to log-in to
Django, why is this/how can i skip this and use the NTLM?
4. how is windows group membership meant to work at this point? ie.
with the small changes made to backends.py and middleware.py, i cannot
see how/where to test for windows group membership?
Thanks for the help so far, it looks promising that it'll work, i'm
just not sure where/how to investigate the above from here.
Any advice is appreciated.
Best Regards,
Rui