Se rendre au contenu
Menu
Cette question a été signalée
5 Réponses
28520 Vues

Hi,

I installed the LDAP module, and configured it as follow :

LDAP filter : uid=%s

Question : What are the variable used by openerp for LDAP filter (%uid, %mail, %s...etc) ?

Moreover, I'd like something like this :

LDAP filter : (&(uid=%s)(memberOf=cn=share,ou=Groups,dc=ip-198-27-46,dc=net))

Finally, I'd also like to have Openerp-ldap-module retrieve my users emails as well as their username...is it possible ?

Thank you.

Avatar
Ignorer
Meilleure réponse

Thanks a lot for the filter, this helps me a lot :)

Avatar
Ignorer
Meilleure réponse

It is possible you retrieve your users emails as well as their username.

Do it :

Modify the source code of auth_ldap module.

open users_ldap.py go to map_ldap_attributes methode.

replace this code :

values = { 'name': ldap_entry[1]['cn'][0],

'login': login,

'company_id': conf['company'],

}


by this:

if(ldap_entry[1].has_key('mail')):

values = { 'name': ldap_entry[1]['cn'][0],

'login': login,

'company_id': conf['company'],

'email': ldap_entry[1]['mail'][0],

}

else:

values = { 'name': ldap_entry[1]['cn'][0],

'login': login,

'company_id': conf['company'],

}


best regards.

Avatar
Ignorer
Meilleure réponse

Hello sulliwan, I just got the same issue here. have you got success can you share your experience. thanks

Avatar
Ignorer
Meilleure réponse

Your filter depends on the LDAP server and what you want as username. With an LDAP browser (search on internet) you can see and check what your LDAP filter and LDAP base should be set to. For example I have "sAMAccountName=%s" as filter and "OU=SBSUsers,OU=Users,OU=MyBusiness,DC=DOMAIN,DC=local" as base. LDAP is on a SBS2011 server. Users can log on to OpenERP with their own username & password.

Avatar
Ignorer
Auteur

I use the exact same filter on owncloud ldap-module, and it works great against my ldap server : (&(uid=%s)(memberOf=cn=share,ou=Groups,dc=ip-198-27-46,dc=net)). If changing the ldap base to cn=share,ou=Groups,dc=ip-198-27-46,dc=net, the authentication stop working...thx for your anwser

Publications associées Réponses Vues Activité
3
déc. 23
27075
0
avr. 20
4370
1
nov. 18
6066
9
nov. 18
17501
2
mars 17
3784