AUTH_LDAP_REQUIRE_GROUP error in backend.py

42 views
Skip to first unread message

Quigster

unread,
Feb 23, 2013, 4:20:40 PM2/23/13
to django-a...@googlegroups.com
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?


Peter Sagerson

unread,
Feb 23, 2013, 4:28:37 PM2/23/13
to django-a...@googlegroups.com
Unquoting the value of AUTH_LDAP_GROUP_TYPE should fix that. That setting should be an object, not a string.
> --
> You received this message because you are subscribed to the Google Groups "django-auth-ldap" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to django-auth-ld...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Quigster

unread,
Feb 23, 2013, 5:21:21 PM2/23/13
to django-a...@googlegroups.com
Thanks, Peter. That did the trick. 

Cheers,
John

Di majo

unread,
May 12, 2024, 2:00:15 PM5/12/24
to django-auth-ldap
MT103/202 DIRECT WIRE TRANSFER
PAYPAL TRANSFER
CASHAPP TRANSFER
ZELLE TRANSFER
LOAN DEAL
TRANSFER WISE
WESTERN UNION TRANSFER
BITCOIN FLASHING
BANK ACCOUNT LOADING/FLASHING
IBAN TO IBAN TRANSFER
MONEYGRAM TRANSFER
IPIP/DTC
SLBC PROVIDER
CREDIT CARD TOP UP
DUMPS/ PINS
SEPA TRANSFER
WIRE TRANSFER
BITCOIN TOP UP
GLOBALPAY INC US
SKRILL USA
UNIONPAY RECEIVER

Thanks.


NOTE; ONLY SERIOUS / RELIABLE RECEIVERS CAN CONTACT.

DM ME ON WHATSAPP
+44 7529 555638
Reply all
Reply to author
Forward
0 new messages