[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GMG-Devel] LDAP plugin Mediagoblin

From: Tarik Dadi
Subject: [GMG-Devel] LDAP plugin Mediagoblin
Date: Sat, 1 Mar 2014 23:36:00 +0100

Hello guys, 

I just discovered recently the mediagoblin project and i love it.

I then wanted to use it with LDAP authentification, unfortunately it seems that the LDAP plugin is not complete.

My LDAP configuration needs the following parameters in the mediagobelin.ini file :


LDAP_SERVER_URI = 'ldap://' 
LDAP_BIND_DN = "cn=webuser,dc=eisti,dc=fr » 
LDAP_BIND_PW = "pwebalc! » 
LDAP_SEARCH_BASE = 'ou=People,dc=eisti,dc=fr’ 
LDAP_SEARCH_FILTER = '(uid={0})’ 
LDAP_SEARCH_BASE = 'ou=people,dc=eisti,dc=fr, ldap.SCOPE_SUBTREE, (uid=%(user)s)’

#LDAP_USER_DN_TEMPLATE = 'cn={webuser},ou=people,dc=eisti,dc=fr'

And I believe that improvement are needed in the file of the LDAP plugin :

# New function
def _login_template(self, server, username, password): 

#New function
def _login_dblbind(self, server, username, password): 

def login(self, username, password): 
for k, v in self.ldap_settings.iteritems(): 

# Here, we should adapt to the LDAP server, if there is a search_filter and a bind_dn & bind_pw, an anonymous bind + research
# If the USER_DN_TEMPLATE attribut is present we should use the template method

user_dn = v['LDAP_USER_DN_TEMPLATE'].format(username=username) 
self.conn.simple_bind_s(user_dn, password.encode('utf8')) 
email = self._get_email(v, username) 
return username, email 
except ldap.LDAPError, e: 
finally:'Unbinding {0}.'.format(v['LDAP_SERVER_URI'])) 

return False, None

I’m new to python/django programming, i don’t know if the ideas that I’ve given are worthy. So if there is someone who knows more…

Thank you

reply via email to

[Prev in Thread] Current Thread [Next in Thread]