[GeoNode-devel] Connection through LDAP doesn't work

Samuel POTTER samuel.potter at cirad.fr
Mon Sep 30 04:39:24 PDT 2019


Hi,

I'm trying to set up a LDAP for the company I'm working for as an intern. I checked the 2.8 geonode documentation and I added the following line to my local_setting.py by changing all the information inside of course.
import ldap
from django_auth_ldap.config import LDAPSearch

AUTHENTICATION_BACKENDS = (
    'django_auth_ldap.backend.LDAPBackend',
    'django.contrib.auth.backends.ModelBackend',
    'guardian.backends.ObjectPermissionBackend',
)
AUTH_LDAP_SERVER_URI = 'ldap://ldap.example.com'
LDAP_SEARCH_DN = 'ou=users,dc=example,dc=com'
AUTH_LDAP_USER = '(uid=%(user)s)'
AUTH_LDAP_BIND_DN = '{ADD_BIND_DN_IF_REQUIRED}'
AUTH_LDAP_BIND_PASSWORD = '{ADD_BIND_PASSWORD_IF_REQUIRED}'
AUTH_LDAP_USER_ATTR_MAP = {
    'first_name': 'givenName', 'last_name': 'sn', 'email': 'mail',
}
AUTH_LDAP_USER_SEARCH = LDAPSearch(LDAP_SEARCH_DN,
                                   ldap.SCOPE_SUBTREE, AUTH_LDAP_USER)

Then I checked my ldap.conf file and added the URI and the BASE in it too. When I make ldapsearch -x -LLL uid=* uid > result, I have the list of the LDAP people in it. But when I tried to connect to the site with my account that is in the list, It's impossible. I'm probably missing something but I don't know what. 



More information about the geonode-devel mailing list