A django-shibboleth
module is available which can be used to obtain attributes from an IdP and map them to users in the Django auth system. Most of the work is done by Shibboleth itself, with only a small amount of code required for the mapping.
Follow the Shibboleth instructions for setting up your local Shibboleth Service Provider (SP) for use with an IdP.
In the http.conf file or your own app configuration in conf.d, create the following entry.
<Location /shibboleth>
AuthType shibboleth
ShibRequireSession On
ShibUseHeaders On
require valid-user
</Location>
This should result in the URLs to /shibboleth being directed to the IdP login page. After successfully logging on, a 404 page will be returned.
Add the configuration, replacing app with the name of your app.
<Location "/">
SetHandler mod_python
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE app.settings
PythonDebug Off
</Location>
This should result in the following error after login in via the /shibboleth URL.
The current URL, Shibboleth.sso/ADFS, didn't match any of these.
To solve this problem you need to add the following to the configuration.
<Location /Shibboleth.sso>
SetHandler None
</Location>
/var/log/shibboleth/transaction.log
should tell you what attributes are released.