owncloud / owncloud/user_ldap

Cannot log into ownCloud Server when one of the LDAP Servers written in the wizard have a wrong credentials

Open
#49 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug sev3-medium
Dominant language
PHP
Stars
17
Forks
19
Avg merge
11h 40m
Merged PRs (30d)
2

Description

Steps to reproduce
  1. As admin enable LDAP app
  2. In LDAP section enable two LDAP configurations
  3. Make one of the LDAP server backend not accesible changing the data written in the LDAP wizard with a wrong one
  4. Try to log in with a user from the other LDAP Server (aaliyah_beer in this case)
Expected behaviour

The users that belongs to the other LDAP server should be able to log in

Actual behaviour

No user can log into the oC server. Error is shown

Server configuration

Operating system:
Ubuntu 16.04

Web server:
Apache

Database:
MySQL

PHP version:
5.6

ownCloud version:

"9.1.3.1","versionstring":"9.1.3","edition":"Enterprise"

Updated from an older ownCloud or fresh install:
Fresh

Are you using external storage, if yes which one: local/smb/sftp/...
No

Are you using encryption:
No

Logs

{"reqId":"xMpur2mMXjlbv0OwSgkL","remoteAddr":"82.159.139.58","app":"no app in context","message":"Exception: {\"Exception\":\"OC\\\\ServerNotAvailableException\",\"Message\":\"Lost connection to LDAP server.\",\"Code\":0,\"Trace\":\"#0 \\\/opt\\\/owncloud\\\/apps\\\/user_ldap\\\/lib\\\/LDAP.php(257): OCA\\\\User_LDAP\\\\LDAP->postFunctionCall()\\n#1 \\\/opt\\\/owncloud\\\/apps\\\/user_ldap\\\/lib\\\/LDAP.php(43): OCA\\\\User_LDAP\\\\LDAP->invokeLDAPMethod('bind', Resource id #90, 'cn=admin,dc=own...', 'owncloud123')\\n#2 \\\/opt\\\/owncloud\\\/apps\\\/user_ldap\\\/lib\\\/Connection.php(600): OCA\\\\User_LDAP\\\\LDAP->bind(Resource id #90, 'cn=admin,dc=own...', 'owncloud123')\\n#3 \\\/opt\\\/owncloud\\\/apps\\\/user_ldap\\\/lib\\\/Connection.php(527): OCA\\\\User_LDAP\\\\Connection->bind()\\n#4 \\\/opt\\\/owncloud\\\/apps\\\/user_ldap\\\/lib\\\/Connection.php(158): OCA\\\\User_LDAP\\\\Connection->establishConnection()\\n#5 \\\/opt\\\/owncloud\\\/apps\\\/user_ldap\\\/lib\\\/Connection.php(166): OCA\\\\User_LDAP\\\\Connection->init()\\n#6 \\\/opt\\\/owncloud\\\/apps\\\/user_ldap\\\/lib\\\/Access.php(158): OCA\\\\User_LDAP\\\\Connection->getConnectionResource()\\n#7 \\\/opt\\\/owncloud\\\/apps\\\/user_ldap\\\/lib\\\/User_LDAP.php(219): OCA\\\\User_LDAP\\\\Access->readAttribute('uid=aaliyah_bee...', '', '(&(|(objectclas...')\\n#8 \\\/opt\\\/owncloud\\\/apps\\\/user_ldap\\\/lib\\\/User_LDAP.php(274): OCA\\\\User_LDAP\\\\User_LDAP->userExistsOnLDAP(Object(OCA\\\\User_LDAP\\\\User\\\\User))\\n#9 \\\/opt\\\/owncloud\\\/apps\\\/user_ldap\\\/lib\\\/User_LDAP.php(323): OCA\\\\User_LDAP\\\\User_LDAP->userExists('aaliyah_beer')\\n#10 [internal function]: OCA\\\\User_LDAP\\\\User_LDAP->getHome('aaliyah_beer')\\n#11 \\\/opt\\\/owncloud\\\/apps\\\/user_ldap\\\/lib\\\/User_Proxy.php(67): call_user_func_array(Array, Array)\\n#12 \\\/opt\\\/owncloud\\\/apps\\\/user_ldap\\\/lib\\\/Proxy.php(139): OCA\\\\User_LDAP\\\\User_Proxy->walkBackends('aaliyah_beer', 'getHome', Array)\\n#13 \\\/opt\\\/owncloud\\\/apps\\\/user_ldap\\\/lib\\\/User_Proxy.php(202): OCA\\\\User_LDAP\\\\Proxy->handleRequest('aaliyah_beer', 'getHome', Array)\\n#14 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/User\\\/User.php(251): OCA\\\\User_LDAP\\\\User_Proxy->getHome('aaliyah_beer')\\n#15 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/Files\\\/Mount\\\/LocalHomeMountProvider.php(41): OC\\\\User\\\\User->getHome()\\n#16 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/Files\\\/Config\\\/MountProviderCollection.php(97): OC\\\\Files\\\\Mount\\\\LocalHomeMountProvider->getHomeMountForUser(Object(OC\\\\User\\\\User), Object(OC\\\\Files\\\\Storage\\\\StorageFactory))\\n#17 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/Files\\\/Filesystem.php(435): OC\\\\Files\\\\Config\\\\MountProviderCollection->getHomeMountForUser(Object(OC\\\\User\\\\User))\\n#18 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/Files\\\/Filesystem.php(373): OC\\\\Files\\\\Filesystem::initMountPoints('aaliyah_beer')\\n#19 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/legacy\\\/util.php(231): OC\\\\Files\\\\Filesystem::init('aaliyah_beer', '\\\/aaliyah_beer\\\/f...')\\n#20 \\\/opt\\\/owncloud\\\/apps\\\/user_ldap\\\/lib\\\/FilesystemHelper.php(44): OC_Util::setupFS('aaliyah_beer')\\n#21 \\\/opt\\\/owncloud\\\/apps\\\/user_ldap\\\/lib\\\/User\\\/User.php(519): OCA\\\\User_LDAP\\\\FilesystemHelper->setup('aaliyah_beer')\\n#22 \\\/opt\\\/owncloud\\\/apps\\\/user_ldap\\\/lib\\\/User\\\/User.php(499): OCA\\\\User_LDAP\\\\User\\\\User->setOwnCloudAvatar()\\n#23 \\\/opt\\\/owncloud\\\/apps\\\/user_ldap\\\/lib\\\/User\\\/User.php(481): OCA\\\\User_LDAP\\\\User\\\\User->updateAvatar()\\n#24 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/legacy\\\/hook.php(105): OCA\\\\User_LDAP\\\\User\\\\User->updateAvatarPostLogin(Array)\\n#25 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/Server.php(268): OC_Hook::emit('OC_User', 'post_login', Array)\\n#26 [internal function]: OC\\\\Server->OC\\\\{closure}(Object(OC\\\\User\\\\User), 'secret')\\n#27 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/Hooks\\\/EmitterTrait.php(98): call_user_func_array(Object(Closure), Array)\\n#28 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/Hooks\\\/PublicEmitter.php(32): OC\\\\Hooks\\\\BasicEmitter->emit('\\\\\\\\OC\\\\\\\\User', 'postLogin', Array)\\n#29 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/User\\\/Session.php(439): OC\\\\Hooks\\\\PublicEmitter->emit('\\\\\\\\OC\\\\\\\\User', 'postLogin', Array)\\n#30 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/User\\\/Session.php(287): OC\\\\User\\\\Session->loginWithPassword(*** sensitive parameters replaced ***)\\n#31 \\\/opt\\\/owncloud\\\/core\\\/Controller\\\/LoginController.php(196): OC\\\\User\\\\Session->login(*** sensitive parameters replaced ***)\\n#32 [internal function]: OC\\\\Core\\\\Controller\\\\LoginController->tryLogin(*** sensitive parameters replaced ***)\\n#33 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/AppFramework\\\/Http\\\/Dispatcher.php(159): call_user_func_array(Array, Array)\\n#34 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/AppFramework\\\/Http\\\/Dispatcher.php(89): OC\\\\AppFramework\\\\Http\\\\Dispatcher->executeController(Object(OC\\\\Core\\\\Controller\\\\LoginController), 'tryLogin')\\n#35 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/AppFramework\\\/App.php(99): OC\\\\AppFramework\\\\Http\\\\Dispatcher->dispatch(Object(OC\\\\Core\\\\Controller\\\\LoginController), 'tryLogin')\\n#36 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/AppFramework\\\/Routing\\\/RouteActionHandler.php(46): OC\\\\AppFramework\\\\App::main('LoginController', 'tryLogin', Object(OC\\\\AppFramework\\\\DependencyInjection\\\\DIContainer), Array)\\n#37 [internal function]: OC\\\\AppFramework\\\\Routing\\\\RouteActionHandler->__invoke(Array)\\n#38 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/Route\\\/Router.php(280): call_user_func(Object(OC\\\\AppFramework\\\\Routing\\\\RouteActionHandler), Array)\\n#39 \\\/opt\\\/owncloud\\\/lib\\\/base.php(891): OC\\\\Route\\\\Router->match('\\\/login')\\n#40 \\\/opt\\\/owncloud\\\/index.php(54): OC::handleRequest()\\n#41 {main}\",\"File\":\"\\\/opt\\\/owncloud\\\/apps\\\/user_ldap\\\/lib\\\/LDAP.php\",\"Line\":284}","level":3,"time":"2017-02-10T13:16:12+00:00","method":"POST","url":"\/index.php\/login","user":"aaliyah_beer"}
{"reqId":"xMpur2mMXjlbv0OwSgkL","remoteAddr":"82.159.139.58","app":"index","message":"Exception: {\"Exception\":\"OC\\\\ServerNotAvailableException\",\"Message\":\"Lost connection to LDAP server.\",\"Code\":0,\"Trace\":\"#0 \\\/opt\\\/owncloud\\\/apps\\\/user_ldap\\\/lib\\\/LDAP.php(257): OCA\\\\User_LDAP\\\\LDAP->postFunctionCall()\\n#1 \\\/opt\\\/owncloud\\\/apps\\\/user_ldap\\\/lib\\\/LDAP.php(43): OCA\\\\User_LDAP\\\\LDAP->invokeLDAPMethod('bind', Resource id #90, 'cn=admin,dc=own...', 'owncloud123')\\n#2 \\\/opt\\\/owncloud\\\/apps\\\/user_ldap\\\/lib\\\/Connection.php(600): OCA\\\\User_LDAP\\\\LDAP->bind(Resource id #90, 'cn=admin,dc=own...', 'owncloud123')\\n#3 \\\/opt\\\/owncloud\\\/apps\\\/user_ldap\\\/lib\\\/Connection.php(527): OCA\\\\User_LDAP\\\\Connection->bind()\\n#4 \\\/opt\\\/owncloud\\\/apps\\\/user_ldap\\\/lib\\\/Connection.php(158): OCA\\\\User_LDAP\\\\Connection->establishConnection()\\n#5 \\\/opt\\\/owncloud\\\/apps\\\/user_ldap\\\/lib\\\/Connection.php(166): OCA\\\\User_LDAP\\\\Connection->init()\\n#6 \\\/opt\\\/owncloud\\\/apps\\\/user_ldap\\\/lib\\\/Access.php(158): OCA\\\\User_LDAP\\\\Connection->getConnectionResource()\\n#7 \\\/opt\\\/owncloud\\\/apps\\\/user_ldap\\\/lib\\\/User_LDAP.php(219): OCA\\\\User_LDAP\\\\Access->readAttribute('uid=aaliyah_bee...', '', '(&(|(objectclas...')\\n#8 \\\/opt\\\/owncloud\\\/apps\\\/user_ldap\\\/lib\\\/User_LDAP.php(274): OCA\\\\User_LDAP\\\\User_LDAP->userExistsOnLDAP(Object(OCA\\\\User_LDAP\\\\User\\\\User))\\n#9 \\\/opt\\\/owncloud\\\/apps\\\/user_ldap\\\/lib\\\/User_LDAP.php(323): OCA\\\\User_LDAP\\\\User_LDAP->userExists('aaliyah_beer')\\n#10 [internal function]: OCA\\\\User_LDAP\\\\User_LDAP->getHome('aaliyah_beer')\\n#11 \\\/opt\\\/owncloud\\\/apps\\\/user_ldap\\\/lib\\\/User_Proxy.php(67): call_user_func_array(Array, Array)\\n#12 \\\/opt\\\/owncloud\\\/apps\\\/user_ldap\\\/lib\\\/Proxy.php(139): OCA\\\\User_LDAP\\\\User_Proxy->walkBackends('aaliyah_beer', 'getHome', Array)\\n#13 \\\/opt\\\/owncloud\\\/apps\\\/user_ldap\\\/lib\\\/User_Proxy.php(202): OCA\\\\User_LDAP\\\\Proxy->handleRequest('aaliyah_beer', 'getHome', Array)\\n#14 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/User\\\/User.php(251): OCA\\\\User_LDAP\\\\User_Proxy->getHome('aaliyah_beer')\\n#15 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/Files\\\/Mount\\\/LocalHomeMountProvider.php(41): OC\\\\User\\\\User->getHome()\\n#16 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/Files\\\/Config\\\/MountProviderCollection.php(97): OC\\\\Files\\\\Mount\\\\LocalHomeMountProvider->getHomeMountForUser(Object(OC\\\\User\\\\User), Object(OC\\\\Files\\\\Storage\\\\StorageFactory))\\n#17 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/Files\\\/Filesystem.php(435): OC\\\\Files\\\\Config\\\\MountProviderCollection->getHomeMountForUser(Object(OC\\\\User\\\\User))\\n#18 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/Files\\\/Filesystem.php(373): OC\\\\Files\\\\Filesystem::initMountPoints('aaliyah_beer')\\n#19 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/legacy\\\/util.php(231): OC\\\\Files\\\\Filesystem::init('aaliyah_beer', '\\\/aaliyah_beer\\\/f...')\\n#20 \\\/opt\\\/owncloud\\\/apps\\\/user_ldap\\\/lib\\\/FilesystemHelper.php(44): OC_Util::setupFS('aaliyah_beer')\\n#21 \\\/opt\\\/owncloud\\\/apps\\\/user_ldap\\\/lib\\\/User\\\/User.php(519): OCA\\\\User_LDAP\\\\FilesystemHelper->setup('aaliyah_beer')\\n#22 \\\/opt\\\/owncloud\\\/apps\\\/user_ldap\\\/lib\\\/User\\\/User.php(499): OCA\\\\User_LDAP\\\\User\\\\User->setOwnCloudAvatar()\\n#23 \\\/opt\\\/owncloud\\\/apps\\\/user_ldap\\\/lib\\\/User\\\/User.php(481): OCA\\\\User_LDAP\\\\User\\\\User->updateAvatar()\\n#24 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/legacy\\\/hook.php(105): OCA\\\\User_LDAP\\\\User\\\\User->updateAvatarPostLogin(Array)\\n#25 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/Server.php(268): OC_Hook::emit('OC_User', 'post_login', Array)\\n#26 [internal function]: OC\\\\Server->OC\\\\{closure}(Object(OC\\\\User\\\\User), 'secret')\\n#27 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/Hooks\\\/EmitterTrait.php(98): call_user_func_array(Object(Closure), Array)\\n#28 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/Hooks\\\/PublicEmitter.php(32): OC\\\\Hooks\\\\BasicEmitter->emit('\\\\\\\\OC\\\\\\\\User', 'postLogin', Array)\\n#29 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/User\\\/Session.php(439): OC\\\\Hooks\\\\PublicEmitter->emit('\\\\\\\\OC\\\\\\\\User', 'postLogin', Array)\\n#30 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/User\\\/Session.php(287): OC\\\\User\\\\Session->loginWithPassword(*** sensitive parameters replaced ***)\\n#31 \\\/opt\\\/owncloud\\\/core\\\/Controller\\\/LoginController.php(196): OC\\\\User\\\\Session->login(*** sensitive parameters replaced ***)\\n#32 [internal function]: OC\\\\Core\\\\Controller\\\\LoginController->tryLogin(*** sensitive parameters replaced ***)\\n#33 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/AppFramework\\\/Http\\\/Dispatcher.php(159): call_user_func_array(Array, Array)\\n#34 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/AppFramework\\\/Http\\\/Dispatcher.php(89): OC\\\\AppFramework\\\\Http\\\\Dispatcher->executeController(Object(OC\\\\Core\\\\Controller\\\\LoginController), 'tryLogin')\\n#35 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/AppFramework\\\/App.php(99): OC\\\\AppFramework\\\\Http\\\\Dispatcher->dispatch(Object(OC\\\\Core\\\\Controller\\\\LoginController), 'tryLogin')\\n#36 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/AppFramework\\\/Routing\\\/RouteActionHandler.php(46): OC\\\\AppFramework\\\\App::main('LoginController', 'tryLogin', Object(OC\\\\AppFramework\\\\DependencyInjection\\\\DIContainer), Array)\\n#37 [internal function]: OC\\\\AppFramework\\\\Routing\\\\RouteActionHandler->__invoke(Array)\\n#38 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/Route\\\/Router.php(280): call_user_func(Object(OC\\\\AppFramework\\\\Routing\\\\RouteActionHandler), Array)\\n#39 \\\/opt\\\/owncloud\\\/lib\\\/base.php(891): OC\\\\Route\\\\Router->match('\\\/login')\\n#40 \\\/opt\\\/owncloud\\\/index.php(54): OC::handleRequest()\\n#41 {main}\",\"File\":\"\\\/opt\\\/owncloud\\\/apps\\\/user_ldap\\\/lib\\\/LDAP.php\",\"Line\":284}","level":3,"time":"2017-02-10T13:16:12+00:00","method":"POST","url":"\/index.php\/login","user":"aaliyah_beer"}
Client configuration

browser

Mozilla

screen shot 2017-02-10 at 14 16 15

@jvillafanez

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with apps/user_ldap/lib/LDAP.php and follow the failing bind through Connection.php, Access.php, User_LDAP.php, and User_Proxy.php. Reproduce the two-configuration case with one invalid LDAP credential and one valid server. Done means users from the reachable LDAP server can log in despite the other backend being unavailable.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
authentication, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.