grnet/synnefo — pull request #331 by cstavr (2014-12-07 13:10:37+00:00)
Title: astakos: Support LDAP authentication

Support LDAP authentication to Astakos by creating the `LDAP` authentication provider,
which is based on the existing third-party login mechanism of Astakos.

The new provider is using the 'django-auth-ldap' package to authenticate against an LDAP
service. The 'django-auth-ldap' package is by default creating a Django user,
which does not fit with how Astakos is handling users (AstakosUser model) and third-party
sign ups (e.g. email verification). Because of this, we are using 'django-auth-ldap' only to
authenticate against the LDAP service and bypass the Django user handling by making it
create a mocked user object which is not stored in DB. Then the AstakosUser creation is
performed in the same way as all other third-party authentication providers (e.g. shibboleth,
twitter).

In order to use the new provider, the admin has to set the basic settings that are required
by 'django-auth-ldap' in order to authenticate with the LDAP service, and then customize
the provider's behaviour by using the Astakos settings for the LDAP provider
(`ASTAKOS_AUTH_PROVIDER_LDAP_*`).

Finally, this PR includes some minor fixes and extensions to existing authentication
providers that emerged while creating the new provider.