aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav/lib/Server.php
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2017-05-18 20:09:51 +0200
committerLukas Reschke <lukas@statuscode.ch>2017-05-18 20:49:10 +0200
commitdf3909a7c360f079d3e47401414a38dc7f3494cf (patch)
tree05436400229200b893df2e92a6d239d9e1fd1af4 /apps/dav/lib/Server.php
parent30552090bccc0d77446d57f5b94ae27ad2d81186 (diff)
downloadnextcloud-server-df3909a7c360f079d3e47401414a38dc7f3494cf.tar.gz
nextcloud-server-df3909a7c360f079d3e47401414a38dc7f3494cf.zip
Use Bearer backend for SabreDAV
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
Diffstat (limited to 'apps/dav/lib/Server.php')
-rw-r--r--apps/dav/lib/Server.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/apps/dav/lib/Server.php b/apps/dav/lib/Server.php
index df5b0ea05b6..994ac04033a 100644
--- a/apps/dav/lib/Server.php
+++ b/apps/dav/lib/Server.php
@@ -33,6 +33,7 @@ use OCA\DAV\CardDAV\ImageExportPlugin;
use OCA\DAV\CardDAV\PhotoCache;
use OCA\DAV\Comments\CommentsPlugin;
use OCA\DAV\Connector\Sabre\Auth;
+use OCA\DAV\Connector\Sabre\BearerAuth;
use OCA\DAV\Connector\Sabre\BlockLegacyClientPlugin;
use OCA\DAV\Connector\Sabre\CommentPropertiesPlugin;
use OCA\DAV\Connector\Sabre\CopyEtagHeaderPlugin;
@@ -52,6 +53,7 @@ use OCP\SabrePluginEvent;
use Sabre\CardDAV\VCFExportPlugin;
use Sabre\DAV\Auth\Plugin;
use OCA\DAV\Connector\Sabre\TagsPlugin;
+use Sabre\HTTP\Auth\Bearer;
use SearchDAV\DAV\SearchPlugin;
class Server {
@@ -100,6 +102,12 @@ class Server {
$event = new SabrePluginEvent($this->server);
$dispatcher->dispatch('OCA\DAV\Connector\Sabre::authInit', $event);
+ $bearerAuthBackend = new BearerAuth(
+ \OC::$server->getUserSession(),
+ \OC::$server->getSession(),
+ \OC::$server->getRequest()
+ );
+ $authPlugin->addBackend($bearerAuthBackend);
// because we are throwing exceptions this plugin has to be the last one
$authPlugin->addBackend($authBackend);