Skip to content

Commit

Permalink
added Application Ecosystem V2 login handler
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
  • Loading branch information
bigcat88 authored and andrey18106 committed Aug 10, 2023
1 parent 7711928 commit 10d24cd
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/base.php
Expand Up @@ -1138,6 +1138,9 @@ public static function handleLogin(OCP\IRequest $request): bool {
if (OC_User::handleApacheAuth()) {
return true;
}
if (self::tryAppEcosystemV2Login($request)) {
return true;
}
if ($userSession->tryTokenLogin($request)) {
return true;
}
Expand Down Expand Up @@ -1175,6 +1178,18 @@ protected static function handleAuthHeaders(): void {
}
}
}

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;
}
$appEcosystemV2Service = Server::get(OCA\AppEcosystemV2\Service\AppEcosystemV2Service::class);
return $appEcosystemV2Service->validateExAppRequestToNC($request);
}
}

OC::init();

0 comments on commit 10d24cd

Please sign in to comment.