To be able to use Basic Authentification in repoze.who running in a wsgi app in your Apache installation, you need to tell Apache to WSGIPassAuthorization. An Apache configuration like this will do:

# Setup mod_wsgi
WSGIPythonHome /var/www/pylons/runtime
WSGIScriptAlias /myApp /var/www/pylons/myApp/mod_wsgi/dispatch.wsgi
WSGIPassAuthorization On

<directory /var/www/pylons/myApp/mod_wsgi>
Order deny,allow
Allow from all
</directory>

The importanat part here is

WSGIPassAuthorization On

This will pass HTTP authorisation headers through to the WSGI application.

Sources: Repoze-dev Mailing List, modwsgi Wiki

Leave a comment