I want use django-auth-ldap only for user authtorizion and
authenticate users from another backend.
I add some modifications to django-auth-ldap. Changeset:
https://bitbucket.org/kamedov/django-auth-ldap/changeset/2e966830eaad
Usage example:
# ~*~ my-backend.py ~*~
from django_auth_ldap.backend import LDAPBackend, _LDAPUser
from django_cas.backends import CASBackend
class CasLdapBackend(CASBackend, LDAPBackend):
def authenticate(self, ticket, service):
"""Authenticates CAS ticket and retrieves user data from
LDAP"""
user = CASBackend.authenticate(self, ticket, service)
ldap_user = _LDAPUser(self, user=user)
ldap_user.authtorize()
return ldap_user.get_user()
def get_user(self, user_id):
return LDAPBackend.get_user(self, user_id)