summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@owncloud.com>2016-04-27 10:50:17 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2016-05-11 13:36:46 +0200
commit7e7d5a2ef2ff583854104c5a327619e3df6a1200 (patch)
treecf500a54dc4670ed6ab04c50c9168f18113a93c8 /lib/private
parentfdc2cd755477220c027e026aa70594af87427bed (diff)
downloadnextcloud-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.php7
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()) {