With the following platform
python 2.7
Django 1.4.2
django_auth_ldap 1.1.3
python_ldap 2.4.10
and while using the following (sanitized) settings in my django app:
AUTH_LDAP_SERVER_URI = "ldaps://path.to.myserver/"
AUTH_LDAP_BIND_DN = ''
AUTH_LDAP_BIND_PASSWORD = ''
AUTH_LDAP_USER_DN_TEMPLATE = 'uid=%(user)s,ou=Users,dc=A,dc=B,dc=C'
AUTH_LDAP_GROUP_SEARCH = "LDAPSearch( 'ou=Groups,dc=A,dc=B,dc=C', ldap.SCOPE_SUBTREE, '(objectClass=posixGroup)')"
AUTH_LDAP_GROUP_TYPE = 'PosixGroupType()'
AUTH_LDAP_REQUIRE_GROUP = "cn=MyLoginGroup,ou=Groups,dc=A,dc=B,dc=C"
AUTH_LDAP_ALWAYS_UPDATE_USER = True
I get the following AttributeError in python:
[Sat Feb 23 16:01:02 2013] [error] [23/Feb/2013 16:01:02] ERROR [django_auth_ldap:313] Caught Exception while authenticating quigster
[Sat Feb 23 16:01:02 2013] [error] Traceback (most recent call last):
[Sat Feb 23 16:01:02 2013] [error] File "build/bdist.linux-x86_64/egg/django_auth_ldap/backend.py", line 302, in authenticate
[Sat Feb 23 16:01:02 2013] [error] self._check_requirements()
[Sat Feb 23 16:01:02 2013] [error] File "build/bdist.linux-x86_64/egg/django_auth_ldap/backend.py", line 457, in _check_requirements
[Sat Feb 23 16:01:02 2013] [error] self._check_required_group()
[Sat Feb 23 16:01:02 2013] [error] File "build/bdist.linux-x86_64/egg/django_auth_ldap/backend.py", line 468, in _check_required_group
[Sat Feb 23 16:01:02 2013] [error] is_member = self._get_groups().is_member_of(required_group_dn)
[Sat Feb 23 16:01:02 2013] [error] File "build/bdist.linux-x86_64/egg/django_auth_ldap/backend.py", line 746, in is_member_of
[Sat Feb 23 16:01:02 2013] [error] is_member = self._group_type.is_member(self._ldap_user, group_dn)
[Sat Feb 23 16:01:02 2013] [error] AttributeError: 'str' object has no attribute 'is_member'
Commenting out the AUTH_LDAP_REQUIRE_GROUP field results in a successful login. Is this a bug in backend.py or am I simply missing some more AUTH_LDAP_* stanzas in my config?