views:

71

answers:

2

I am using Apache to authenticate users for Django, but I would like to do so without the popup form that Apache uses in its basic configuration.

How do I embed the login form within a page while still using Apache for authentication?

That is, I'd like a page that says "Please login" and provides a form asking for username and password, and passes this information on to Apache for authentication. (I'd do this over an SSL connection, of course.)

+1  A: 

Perhaps you could do this in django by using mod_python or mod_wsgi access control.

There is an open ticket on django trac for mod_wsgi authentication handler.

More resources on the subject.

rebus
+1  A: 

See:

http://www.peej.co.uk/articles/http-auth-with-html-forms.html

This shows how you can use some JavaScript magic to present your own form for HTTP Basic Authentication. You will find other examples of doing this if you search hard enough with Google.

Alternatively look at mod_auth_tkt at:

http://www.openfusion.com.au/labs/mod_auth_tkt/

It however uses a custom Apache module to do some magic.

Graham Dumpleton
Thank you. I'm not sure moving from Django's authentication to Apache's is worth this much trouble.
chernevik