aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAndy Scherzinger <info@andy-scherzinger.de>2023-08-10 19:11:43 +0200
committerGitHub <noreply@github.com>2023-08-10 19:11:43 +0200
commita38a86e5c42660da3db9a6b2a94da2bc1b329e88 (patch)
treebe8b2e8e616b246414c9b3f841372bc957f13e73 /lib
parent51833a50b836f26399477a33bc3d512f823c939f (diff)
parentf7b2dc8cccb6671f2119e92c00eb182608062136 (diff)
downloadnextcloud-server-a38a86e5c42660da3db9a6b2a94da2bc1b329e88.tar.gz
nextcloud-server-a38a86e5c42660da3db9a6b2a94da2bc1b329e88.zip
Merge pull request #39655 from nextcloud/appecosystem-auth
AppEcosystem Authentification
Diffstat (limited to 'lib')
-rw-r--r--lib/base.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/base.php b/lib/base.php
index 2dd9a4d59f0..b328165fdfa 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -1137,6 +1137,9 @@ class OC {
if (OC_User::handleApacheAuth()) {
return true;
}
+ if (self::tryAppEcosystemV2Login($request)) {
+ return true;
+ }
if ($userSession->tryTokenLogin($request)) {
return true;
}
@@ -1174,6 +1177,22 @@ class OC {
}
}
}
+
+ protected static function tryAppEcosystemV2Login(OCP\IRequest $request): bool {
+ $appManager = Server::get(OCP\App\IAppManager::class);
+ if (!$request->getHeader('AE-SIGNATURE')) {
+ return false;
+ }
+ if (!$appManager->isInstalled('app_ecosystem_v2')) {
+ return false;
+ }
+ try {
+ $appEcosystemV2Service = Server::get(OCA\AppEcosystemV2\Service\AppEcosystemV2Service::class);
+ return $appEcosystemV2Service->validateExAppRequestToNC($request);
+ } catch (\Psr\Container\NotFoundExceptionInterface|\Psr\Container\ContainerExceptionInterface $e) {
+ return false;
+ }
+ }
}
OC::init();