Finally! =)

I downloaded [1] and added it as a new class in
django/contrib/auth/backends.py.

And then edited settings.py:
"""
[...]
AUTHENTICATION_BACKENDS = (
    'django.contrib.auth.backends.LDAPBackend',
    #'django.contrib.auth.backends.ModelBackend',
)

import ldap

LDAP_DEBUG = True
LDAP_SERVER_URI = 'ldap://SERVER.DOMAIN.biz:389'
LDAP_PREBINDDN = 'ldap_admin_u...@domain.biz'
LDAP_PREBINDPW = 'PASSWORD'
LDAP_SEARCHDN = 'OU=XXX,DC=DOMAIN,DC=biz'
LDAP_SEARCH_FILTER = 'cn=%s'
LDAP_SCOPE = ldap.SCOPE_SUBTREE
"""

But the problem is that when someone login on Admin, shows that the username
or the password is wrong (altought the user is indeed created at this
moment). That's bec the user isn't in staff.
So, I chanded [1] this way:
"""
    [...]
    def _create_user_object(self, username, password):
        return User(username=username, password=password,* is_staff=True*)
    [...]
"""

Latter, I need to use the superuser to set permissions to each new user.

[1] http://code.djangoproject.com/attachment/ticket/2507/ldapauth.py


On Thu, Feb 19, 2009 at 1:25 PM, Antoni Aloy <antoni.a...@gmail.com> wrote:

> At least in our LDAP configuration, there are restrictions about the
> kind of queries that a user can do. So check also this. Use your
> account to see if you can log in, and try to run the function step by
> step inside the shell.
>
> I you don't have restrictions on your LDAP the most commont issue is
> with the LDAP base tree. That is where the user tree resides in your
> organization. Use the step by step debugger to know if you can connect
> to LDAP and check if there is aproblem just with LDAP configurations.
>

-- 
João Olavo Baião de Vasconcelos
Bacharel em Ciência da Computação
Analista de Sistemas - Infraestrutura
joaoolavo.wordpress.com

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to