[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [GMG-Devel] LDAP plugin Mediagoblin
From: |
Christopher Allan Webber |
Subject: |
Re: [GMG-Devel] LDAP plugin Mediagoblin |
Date: |
Fri, 07 Mar 2014 11:58:07 -0600 |
User-agent: |
mu4e 0.9.9.6pre2; emacs 24.1.50.1 |
Note, we discussed this on IRC. Tarik is going to follow up with Rodney
Ewing for more details and report back here if possible. :)
address@hidden writes:
> 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 AUTH
> [[mediagoblin.plugins.ldap]]
>
> [[[EISTI]]]
> LDAP_SERVER_URI = 'ldap://ldap.eisti.fr'
> 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})
> EMAIL_SEARCH_FIELD = 'mail
> 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 tools.py file of the LDAP
> plugin :
>
>
> # New function
> def _login_template(self, server, username, password):
> pass
>
> #New function
> def _login_dblbind(self, server, username, password):
> pass
>
> 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
>
> try:
> self._connect(v)
> 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:
> _log.info(e)
>
> finally:
> _log.info('Unbinding {0}.'.format(v['LDAP_SERVER_URI']))
> self.conn.unbind()
>
> return False, None
>
>
>
> Im new to python/django programming, i dont know if the ideas that Ive given
> are worthy. So if there is someone who knows more&
>
> Thank you
>
>
>
>
>
>
>
>
>
>
>
>
>
> _______________________________________________
> devel mailing list
> address@hidden
> http://lists.mediagoblin.org/listinfo/devel