There is a user with Uid "max.wellgrand" in my ldap. I have a role with a single group attached to it, when I'm trying to add the user to a role (to group), I'm getting following:
So "[u'max.wellgrand']" is a string, should be just "max.wellgrand".
Per my investigation I found that this bug related to following:
File: backendLdap.py function: add_to_groups string attrs = tmp[1]
I have following setup:
There is a user with Uid "max.wellgrand" in my ldap. I have a role with a single group attached to it, when I'm trying to add the user to a role (to group), I'm getting following:
So "[u'max.wellgrand']" is a string, should be just "max.wellgrand".
Per my investigation I found that this bug related to following: File:
backendLdap.py
function:add_to_groups
stringattrs = tmp[1]
So uid key is actually a list, what's happening here:
python's format part does not convert list to string and as a result it becomes broken
It works out of box because default configuration uses dn and
dn = tmp[0]
is string and not list.I'm not sure what the best fix for this yet, for know I just hardcoded fix for myself like following:
attrs['uid'] = attrs['uid'][0]
So as far as I understood, python-ldap lib returns values as a list and not string (feature).