Skip to content

[REFACTOR] LTI: decouple the LTI view and login from Init - #12257

Open
chfsx wants to merge 2 commits into
ILIAS-eLearning:trunkfrom
srsolutionsag:feature/trunk/lti-init-decoupling
Open

chfsx wants to merge 2 commits into
ILIAS-eLearning:trunkfrom
srsolutionsag:feature/trunk/lti-init-decoupling

Conversation

@chfsx

@chfsx chfsx commented Oct 23, 2026

Copy link
Copy Markdown
Member

Follow-up to #12232 (see #12232 (review)): Init no longer knows how the LTI view is set up or how an LTI launch logs in, and the wiring of the view follows the component revision guideline.

Init

  • ilInitialisation no longer calls $DIC['lti']->init(). ilLTIViewLayoutProvider is interested in the main context, which is claimed for every request, and changes only the pages of a user who came from a platform and the LTI pages without a login. It adds the CSS of the view and of the platform and the onload code itself. The lti screen context is no longer claimed; nothing else used it.
  • ilStartUpGUI::doLTIAuthentication() is moved to the new base class ilLTILoginGUI of the LTI component, which lti.php calls. A login that is not accepted still goes to the login page or the account migration of ilStartUpGUI. The URL of lti.php and the command it sends are unchanged.
  • Kept in Init: $DIC['lti'] in AllModernComponents for the unmigrated consumers (ilFrameTargetInfo, ilLocatorGUI), and blockedAuthentication() / ilContextLTIProvider, which share their mechanism with SAML, Shibboleth, WebDAV and WAC.

Wiring of the LTI view

  • LTI::legacy() (lazy proxies via ReflectionClass::newLazyProxy() with global $DIC) is replaced by narrow interfaces for what the view uses of services that are not in the bootstrap yet (CurrentUser, Navigation, ScreenContext, AuthSession in LTI/src/View/), each with a legacy proxy without constructor, wired as $internal.
  • The language and the main template come from the bootstrap ($use[\ILIAS\Language\Language::class], $use[\ILIAS\UICore\GlobalTemplate::class]) instead of the UIServices and ilLanguage objects.
  • ILIAS\LTI\View only offers isActive(), the one method used outside of LTI. The other methods of ilLTIViewGUI are internal; getLaunchTarget() is static, as it only reads the session.
  • LTI.php uses fully qualified names and the order of the init() parameters.

Testing

  • Build: [OK] All static artifacts are build!
  • php-cs-fixer and PHPStan code rules on the changed files: clean.
  • PHPUnit: LTI (80 tests, new ilLTIViewGUITest), Init and Component pass.
  • On an installation: LTI 1.1 and 1.3 launch with redirect to the launched object, exit with and without return URL, Deep Linking selection page, pages of users without LTI unchanged.

@Saaweel could you have a look, as this touches your component? @mjansenDatabay @thibsy for Init.

@Saaweel

Saaweel commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Hi @chfsx, I didn’t realise this could be decoupled like that, much better.

Thank you very much, and as far as I’m concerned, it’s fine, it can be merged. 🙌

@chfsx

chfsx commented Oct 23, 2026

Copy link
Copy Markdown
Member Author

I can provide a ReviewApp for the branch if you would like to test it: http://feature-trunk-lti-init-decoupling.ilias-core.review.sr.solutions (contact me via Discord for credetials)

@Saaweel
Saaweel self-requested a review October 23, 2026 14:34
@Saaweel

Saaweel commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Tested LTI 1.1 on the review installation: launch as learner and as instructor redirects to the launched course with the LTI view and the right role, and exit works with and without return URL.

@mjansenDatabay mjansenDatabay left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx Fabian for the init changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants