[Mageia-sysadm] [618] - add ldap authentication to transifex, so far for sysadmin only ( for

Michael Scherer misc at zarb.org
Wed Dec 15 04:10:08 CET 2010


Le mercredi 15 décembre 2010 à 03:01 +0100, Michael Scherer a écrit :
> Le mercredi 15 décembre 2010 à 02:39 +0100, root at mageia.org a écrit :
> > Revision: 618
> > Author:   misc
> > Date:     2010-12-15 02:39:35 +0100 (Wed, 15 Dec 2010)
> > Log Message:
> > -----------
> > - add ldap authentication to transifex, so far for sysadmin only ( for
> >   testing purposes )
> 
> As asked by dmorgan, ldap support was added to transifex ( and while on
> it, deployed using wsgi and apache ), so we can now find a transifex
> instance on transifex.mageia.org. 
> 
> Member of mga-sysadmin are super users, so we should be able to create
> projects and so on by using our ldap login.
> 
> However, it is not ready yet :
> 
> - no SSL ( so I do not recommend to test yet )
> - no organisation on i18n side, ie, who will be able to connect, how
> will the team be organized ?
> - no theme
> - no usage of email for login
> - no connexion with our svn
> 
> Point 1 will likely be done in one hour.

Done ( and DNS too ).

> Point 4 is also easy, just modify file 45-ldap.conf. Should be done
> soon.

Ok so this part is not as easy as I would have liked :
1) we need to change this ( no real problem ):

@@ -23,7 +23,7 @@ AUTH_LDAP_BIND_DN = "cn=alamut-sympa,ou=System
Accounts,<%= dc_suffix %>"
 AUTH_LDAP_BIND_PASSWORD = "<%= ldap_password %>"
 
 AUTH_LDAP_USER_SEARCH = LDAPSearch("ou=People,<%= dc_suffix %> ",
-    ldap.SCOPE_SUBTREE, "(uid=%(user)s)")
+    ldap.SCOPE_SUBTREE, "(|(uid=%(user)s)(mail=%(user)s))")
 
 # Set up the basic group parameters.
 AUTH_LDAP_GROUP_SEARCH = LDAPSearch("ou=Group,<%= dc_suffix %>",

2) we need to subclass the module to add this method, and use the
subclassed module :

    def ldap_to_django_username(self, username):
        return _LDAPUser(self, username=username).attrs['uid'][0]

Not hard to do, but not for today.
 
-- 
Michael Scherer



More information about the Mageia-sysadm mailing list