From 3d607439073826910a26e2a8abb7eb7d4b509db3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20D=C3=ADaz?= Date: Thu, 8 Oct 2026 13:38:25 +0200 Subject: [PATCH] [LTI] fix: keep LTI launches working with celtic/lti 5.4.4 and later --- .../InternalProvider/class.ilAuthProviderLTI.php | 2 +- .../InternalProvider/class.ilLTIExitException.php | 2 +- .../classes/InternalProvider/class.ilLTITool.php | 10 ++++++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/components/ILIAS/LTIProvider/classes/InternalProvider/class.ilAuthProviderLTI.php b/components/ILIAS/LTIProvider/classes/InternalProvider/class.ilAuthProviderLTI.php index 3d6c4a110a36..9a94ede9c046 100644 --- a/components/ILIAS/LTIProvider/classes/InternalProvider/class.ilAuthProviderLTI.php +++ b/components/ILIAS/LTIProvider/classes/InternalProvider/class.ilAuthProviderLTI.php @@ -257,7 +257,7 @@ public function doAuthentication(\ilAuthStatus $status): bool $lti_provider->kid = $pk['kid']; $lti_provider->signatureMethod = 'RS256'; - $lti_provider->handleRequest(); + $lti_provider->processRequest(); $this->provider = $lti_provider; $this->messageParameters = $this->provider->getMessageParameters(); diff --git a/components/ILIAS/LTIProvider/classes/InternalProvider/class.ilLTIExitException.php b/components/ILIAS/LTIProvider/classes/InternalProvider/class.ilLTIExitException.php index 7fcafc1a3b38..81c72f0fb5be 100644 --- a/components/ILIAS/LTIProvider/classes/InternalProvider/class.ilLTIExitException.php +++ b/components/ILIAS/LTIProvider/classes/InternalProvider/class.ilLTIExitException.php @@ -24,7 +24,7 @@ * The library is designed to be the only thing handling an LTI request, so it ends the request * itself once the message has been processed. ILIAS still has to authenticate the user and send * them to the requested object afterwards, so it asks the library to throw this exception rather - * than to exit, and regains control in ilLTITool::handleRequest(). + * than to exit, and regains control in ilLTITool::processRequest(). */ class ilLTIExitException extends ilException { diff --git a/components/ILIAS/LTIProvider/classes/InternalProvider/class.ilLTITool.php b/components/ILIAS/LTIProvider/classes/InternalProvider/class.ilLTITool.php index 3869f8b79837..bfda29930d1a 100644 --- a/components/ILIAS/LTIProvider/classes/InternalProvider/class.ilLTITool.php +++ b/components/ILIAS/LTIProvider/classes/InternalProvider/class.ilLTITool.php @@ -88,7 +88,13 @@ public function parsePostBody(ArrayBasedRequestWrapper $postData): array return $res; } - public function handleRequest(bool $strictMode = null, bool $disableCookieCheck = false, bool $generateWarnings = false): void + /** + * Process the LTI request and return to ILIAS once the message has been accepted. + * + * This does not override handleRequest(): the library declares that method as never returning, + * while ILIAS needs control back to authenticate the user. + */ + public function processRequest(): void { global $DIC; @@ -107,7 +113,7 @@ public function handleRequest(bool $strictMode = null, bool $disableCookieCheck $this->onExitExceptionClass = ilLTIExitException::class; try { - parent::handleRequest($strictMode, $disableCookieCheck, $generateWarnings); + $this->handleRequest(); } catch (ilLTIExitException $e) { $this->sendPendingResponse(); }