diff options
author | Christoph Wurst <christoph@owncloud.com> | 2016-04-27 10:50:17 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-05-11 13:36:46 +0200 |
commit | 7e7d5a2ef2ff583854104c5a327619e3df6a1200 (patch) | |
tree | cf500a54dc4670ed6ab04c50c9168f18113a93c8 /lib/private | |
parent | fdc2cd755477220c027e026aa70594af87427bed (diff) | |
download | nextcloud-server-7e7d5a2ef2ff583854104c5a327619e3df6a1200.tar.gz nextcloud-server-7e7d5a2ef2ff583854104c5a327619e3df6a1200.zip |
Add fallback to allow user:token basic auth
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/User/Session.php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/private/User/Session.php b/lib/private/User/Session.php index 7fac36626e2..bb35b65b272 100644 --- a/lib/private/User/Session.php +++ b/lib/private/User/Session.php @@ -282,6 +282,13 @@ class Session implements IUserSession, Emitter { $this->session->regenerateId(); $this->manager->emit('\OC\User', 'preLogin', array($uid, $password)); $user = $this->manager->checkPassword($uid, $password); + if ($user === false) { + // Password auth failed, maybe it's a token + $request = \OC::$server->getRequest(); + if ($this->validateToken($request, $password)) { + $user = $this->getUser(); + } + } if ($user !== false) { if (!is_null($user)) { if ($user->isEnabled()) { |