diff options
author | Christoph Wurst <christoph@owncloud.com> | 2016-05-24 14:08:42 +0200 |
---|---|---|
committer | Christoph Wurst <christoph@owncloud.com> | 2016-05-24 17:54:02 +0200 |
commit | 28ce7dd262fbf748c46b915b67ac6c332fed8420 (patch) | |
tree | 4719d5eaa8f66560a12a9ff122b46c35db5188da /apps/dav | |
parent | d3fb5d618ea5902c989c39d72fd6ac2e5bcb65ed (diff) | |
download | nextcloud-server-28ce7dd262fbf748c46b915b67ac6c332fed8420.tar.gz nextcloud-server-28ce7dd262fbf748c46b915b67ac6c332fed8420.zip |
do not allow client password logins if token auth is enforced or 2FA is enabled
Diffstat (limited to 'apps/dav')
-rw-r--r-- | apps/dav/lib/Connector/Sabre/Auth.php | 3 | ||||
-rw-r--r-- | apps/dav/tests/unit/connector/sabre/auth.php | 8 |
2 files changed, 5 insertions, 6 deletions
diff --git a/apps/dav/lib/Connector/Sabre/Auth.php b/apps/dav/lib/Connector/Sabre/Auth.php index 88898f272c5..cbb2c2b63bd 100644 --- a/apps/dav/lib/Connector/Sabre/Auth.php +++ b/apps/dav/lib/Connector/Sabre/Auth.php @@ -103,8 +103,7 @@ class Auth extends AbstractBasic { return true; } else { \OC_Util::setUpFS(); //login hooks may need early access to the filesystem - // TODO: do not allow basic auth if the user is 2FA enforced - if($this->userSession->login($username, $password)) { + if($this->userSession->logClientIn($username, $password)) { $this->userSession->createSessionToken($this->request, $this->userSession->getUser()->getUID(), $username, $password); \OC_Util::setUpFS($this->userSession->getUser()->getUID()); $this->session->set(self::DAV_AUTHENTICATED, $this->userSession->getUser()->getUID()); diff --git a/apps/dav/tests/unit/connector/sabre/auth.php b/apps/dav/tests/unit/connector/sabre/auth.php index 42be21d90fe..d3f697ba8e6 100644 --- a/apps/dav/tests/unit/connector/sabre/auth.php +++ b/apps/dav/tests/unit/connector/sabre/auth.php @@ -167,7 +167,7 @@ class Auth extends TestCase { ->will($this->returnValue('AnotherUser')); $this->userSession ->expects($this->once()) - ->method('login') + ->method('logClientIn') ->with('MyTestUser', 'MyTestPassword') ->will($this->returnValue(true)); $this->userSession @@ -192,7 +192,7 @@ class Auth extends TestCase { ->will($this->returnValue(false)); $this->userSession ->expects($this->once()) - ->method('login') + ->method('logClientIn') ->with('MyTestUser', 'MyTestPassword') ->will($this->returnValue(false)); $this->session @@ -560,7 +560,7 @@ class Auth extends TestCase { ->getMock(); $this->userSession ->expects($this->once()) - ->method('login') + ->method('logClientIn') ->with('username', 'password') ->will($this->returnValue(true)); $this->userSession @@ -602,7 +602,7 @@ class Auth extends TestCase { ->getMock(); $this->userSession ->expects($this->once()) - ->method('login') + ->method('logClientIn') ->with('username', 'password') ->will($this->returnValue(false)); $response = $this->auth->check($server->httpRequest, $server->httpResponse); |