core icon indicating copy to clipboard operation
core copied to clipboard

ldap authentication does not allow empty Base DN

Open russlevy opened this issue 13 years ago • 5 comments

the Base DN should be allowed to be left blank on the LDAP Basic authentication information.

To enable this, the Base DN check has to be removed on line 283 of apps/user_ldap/lib/connection.php and !empty($this->connection->ldapBaseUsers) must be added to the if statement of line 225 of apps/user_ldap/lib/access.php (in function dn2username).

there are many situations where a global search across all DNs is required -- in our case, we have multiple domain name names on different TLDs.

russlevy avatar Dec 23 '12 13:12 russlevy

This is not possible. We need to pass a starting point to LDAP when doing a search. You are probably more interested in this request https://github.com/owncloud/core/issues/395

blizzz avatar Jan 03 '13 11:01 blizzz

Hi, when i modified the code as above and everything works properly. why is it impossible?

russlevy avatar Jan 03 '13 11:01 russlevy

Okay, took a closer look. First, an empyt base is undocumented in the PHP documentation. But it looks to be fine.

A catch is that if the base dn is left empty, the BASE entry in ldap.conf is being used. We do not know what is written there, making it a source of failure. You will need to configure this as well, either by specifying the base DN or assure it is empty.

Because of this error prone config situation, I do not like it. On the other hand I see your scenario. I reopen it and mark the issue as enhancement.

blizzz avatar Jan 03 '13 12:01 blizzz

Once more: with an empty base DN, only the DSE will be searched, which is also dependent on the scope used. A normal search would be done in the base scope, but the search works with subtree scope. In this case, an error code will be returned: no such object (32).

So why do you changes work for you? Maybe because of what is in the /etc/ldap/ldap.conf of your server running ownCloud?

Atm, I rather refrain from including it, but I am open for further arguments.

blizzz avatar Jan 04 '13 22:01 blizzz

Closed for inactivity.

blizzz avatar Jan 30 '13 03:01 blizzz