Opened 15 months ago

Last modified 15 months ago

#11361 new defect

name_attr ldap field is not being caught properly

Reported by: Estopero Owned by: sandinak
Priority: normal Component: DirectoryAuthPlugin
Severity: normal Keywords: ldap, custom fields
Cc: Trac Release: 1.0

Description (last modified by rjollos)

First of all thanks for the plugin, is being very useful for us :)

I think some custom fields are not being caught properly, we are using openLDAP and these are our three fields for user, name and email:

user_attr = uid
name_attr = cn
email_attr = mail

The user_attr is rightly mapped, and I think the email_attr field works because is similar to the ActiveDirectory one, however the name_attr is not being defined and is empty in the user list panel.

I think the problem is that the "displayName" is hardcoded in the attr list line 121
def check_password(self, user, password):
attrs = [ self.user_attr, 'mail', 'proxyAddress', 'displayName']
userinfo = self._get_userinfo(users[0][1])


And in the _get_userinfo function you are looking for a attr field that will never exist if is not called "displayName": line 294
def _get_userinfo(self, attrs):
displayname = attrs.get(self.name_attr, [''])[0]


I'm not a python developer so I'm not sure if this is being the problem but could be. What do you think? :)

Thanks and great work

Attachments (0)

Change History (2)

comment:1 Changed 15 months ago by Estopero

To solve the name_attr mapping issue is enough changing in the linea 121 of

attrs = [ self.user_attr, 'mail', 'proxyAddress', 'displayName']


attrs = [ self.user_attr, 'mail', 'proxyAddress', self.name_attr]

Probably the same happens with 'mail' but didn't try.

I've tried to do a commit but I have no permissions :). sandinak, Would you mind to fix it?


comment:2 Changed 15 months ago by rjollos

  • Description modified (diff)

Add Comment

Modify Ticket

as new The owner will remain sandinak.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.