#11361 closed defect (fixed)
name_attr ldap field is not being caught properly
Reported by: | Estopero | Owned by: | branson |
---|---|---|---|
Priority: | normal | Component: | DirectoryAuthPlugin |
Severity: | normal | Keywords: | ldap, custom fields |
Cc: | Trac Release: | 1.0 |
Description (last modified by )
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:
[account-manager] 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
auth.py: line 121 def check_password(self, user, password): ... attrs = [ self.user_attr, 'mail', 'proxyAddress', 'displayName'] ... userinfo = self._get_userinfo(users[0][1])
directoryauthplugin/trunk/tracext/dirauth/auth.py@13391#L121
And in the _get_userinfo function you are looking for a attr field that will never exist if is not called "displayName":
auth.py: line 294 def _get_userinfo(self, attrs): ... displayname = attrs.get(self.name_attr, [''])[0]
directoryauthplugin/trunk/tracext/dirauth/auth.py@13391#L294
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 (5)
comment:1 Changed 11 years ago by
comment:2 Changed 11 years ago by
Description: | modified (diff) |
---|
comment:4 Changed 9 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
added (and extended) the suggested fix.
To solve the name_attr mapping issue is enough changing in the linea 121 of auth.py
by
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?
Thanks!