Dario Vinella
unread,Feb 21, 2012, 8:29:19 AM2/21/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django-auth-ldap
Hi,
i discovered a strange behavior using django-auth-ldap in my project
when an user that is trying to log in appends or prepends a whitespace
to the username (that is registered without any whitespace). The ldap
backend grants the authentication to this user, but i can see multiple
profile rows in profiles table: one without the spaces and one with
them.
If i try to authenticate with the users "foobar", "foobar " and "
foobar" i get three successful logins and three populated profile
rows.
The db based ModelBacked correctly denies access to " foobar" and
"foobar " instead.
I'm using the builtin django.contrib.auth.views.login, so i'm not
performing any custom validation or strip() on strings passed by the
form, and i'm using the direct binding with
AUTH_LDAP_USER_DN_TEMPLATE = 'cn=%(user)s,ou=users,dc=mysite,dc=gtld'
I don't know if it is a real bug or works as expected, and if it is
related to django-auth-ldap or to python-ldap, so i'm asking if
someone has seen this before.
Dario