You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Meta data missing the username when querying for an ldap user via the provisioning api #15084
LDAP users can have a space in their names; ownCloud does not support spaces in usernames so the space gets converted to an underscore. When we search for the ldap user with a space in the name, we need to remove the underscore to find the user.
I have validated that this works now as expected; closing this as not an issue
From what I understood the problem is about user names that have spaces in them.
As an API consumer, I should be able to pass a user name with space to the "search" argument and get the correct results. So we need to put a fix/workaround either in the provisioning API, or fix the LDAP search code properly retrieve such users (or do the "iterate over the list" workaround there).
Here was the workaround proposed by @jnfrmarks in pyocclient owncloud/pyocclient#85 but I think it's not the right place to do it. (but that code illustrates a possible workaround that we could put in the server code)
Spaces in user names (and other characters) are not allowed.
The issue here is that the configured LDAP attribute, that user names are derived from, contains those. However, you cannot rely that the attribute value will be exactly the user name. Forbidden characters are one thing, name collisions the other (a string will be added). You should not do any assumptions upon the username.
I would rather say that you replace the underscores before doing the search, or to look for the exact attribute value. The downside there is that if many search terms are provided (seperated by underscores) this is split up and compared individually against the search attributes. The purpose was to allow a flexible search against first and last names without knowledge about the internal structure of LDAP attribute values. This may very well turn out in many results in this case.
Frankly speaking, using the display name is a bad way to use as internal username attribute, because it often is user changeable and thus not necessarily unique. I understand the general purpose here is having a test setup, but it is probably better to revise the setup and use uid/samaccountname for the internal username. Theoretically, white spaces are allowed there as well, but they should be avoided. As this is what you usually login against, whitespaces and special characters are practically not used.
@cmonteroluque please leave a comment when changing severity towards high (or critical) so close to the deadline in order to have us notified and able to plan accordingly…
Activity
jnfrmarks commentedon Mar 26, 2015
LDAP users can have a space in their names; ownCloud does not support spaces in usernames so the space gets converted to an underscore. When we search for the ldap user with a space in the name, we need to remove the underscore to find the user.
I have validated that this works now as expected; closing this as not an issue
jnfrmarks commentedon Mar 26, 2015
@PVince81
In discussing my solution with Vincent, he had some feedback/questions on the solution so I am reopening this.
PVince81 commentedon Mar 26, 2015
From what I understood the problem is about user names that have spaces in them.
As an API consumer, I should be able to pass a user name with space to the "search" argument and get the correct results. So we need to put a fix/workaround either in the provisioning API, or fix the LDAP search code properly retrieve such users (or do the "iterate over the list" workaround there).
PVince81 commentedon Mar 26, 2015
@blizzz what do you think ?
PVince81 commentedon Mar 26, 2015
Here was the workaround proposed by @jnfrmarks in pyocclient owncloud/pyocclient#85 but I think it's not the right place to do it. (but that code illustrates a possible workaround that we could put in the server code)
PVince81 commentedon Mar 27, 2015
@tomneedham
blizzz commentedon Mar 30, 2015
Spaces in user names (and other characters) are not allowed.
The issue here is that the configured LDAP attribute, that user names are derived from, contains those. However, you cannot rely that the attribute value will be exactly the user name. Forbidden characters are one thing, name collisions the other (a string will be added). You should not do any assumptions upon the username.
I would rather say that you replace the underscores before doing the search, or to look for the exact attribute value. The downside there is that if many search terms are provided (seperated by underscores) this is split up and compared individually against the search attributes. The purpose was to allow a flexible search against first and last names without knowledge about the internal structure of LDAP attribute values. This may very well turn out in many results in this case.
Frankly speaking, using the display name is a bad way to use as internal username attribute, because it often is user changeable and thus not necessarily unique. I understand the general purpose here is having a test setup, but it is probably better to revise the setup and use uid/samaccountname for the internal username. Theoretically, white spaces are allowed there as well, but they should be avoided. As this is what you usually login against, whitespaces and special characters are practically not used.
PVince81 commentedon Sep 21, 2015
@blizzz how to move forward ?
3 remaining items
blizzz commentedon Oct 2, 2015
@cmonteroluque please leave a comment when changing severity towards high (or critical) so close to the deadline in order to have us notified and able to plan accordingly…
blizzz commentedon Oct 6, 2015
Fix is here: #19600
MorrisJobke commentedon Oct 13, 2015
The fixing PR was moved to 9.0 #19600 (comment)
Moving this too
lock commentedon Aug 5, 2019
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.