Over the last week I’ve been working on another small django site. It’s mainly the usual stuff but one aspect that proved trickier than I expected was using the django maintained authentication system to control access to another service. The other service is run via an apache2 installation and so I figured that mod_authn_dbd configured to use mysql would be all that I needed. Bzzzzt.
Django stores the passwords in a different format than mod_authn_dbd expects. It also uses salts for it’s SHA1 generation, which further complicates the simple password matching that APR does (and is the checking implemented in mod_authn_dbd). I tried a few different ways round it using mysql queries, but all to avail.
The eventual solution I came up with was to adapt mod_authn_dbd into mod_authn_django, with a password checking routine that understands how django stores the passwords and can do the correct things to compare them.
Not sure if it’ll help anyone else, but if there’s any interest I can make it available




3 users commented in " Django & Apache Auth "
Follow-up comment rss or Leave a TrackbackIs there anyway to could send me mod_authn_django as I’m trying to do exactly the same thing
Hi David,
I ran into the same problem with Mod Auth Mysql. I want to get my SVN users authenticating using their django credentials. It sounds like this would do the trick. I have configured a similar system with Bugzilla and would like to get this working with Django. Can you email me or post the code that you used to get this working?
Thanks!
Chris
Hi David,
me too on the being interested. One part where I need it would be also the bugzilla connection, not sure if it can be used there as well (but wouldn’t mind getting to know from Chris if he got it to work).
Thanks,
Jochen
Leave A Reply