phil / lti-bundle
phil/lti in Symfony: an LTI 1.3 tool, platform or both, with the routes of the launch, Deep Linking and the key set, an authenticator for verified launches, the platform services, Doctrine DBAL stores, keys sealed by Symfony KeyManagement and rotated, scores sent through Messenger, and events for th
Package info
github.com/parler-haut-interagir-librement/lti-bundle
Type:symfony-bundle
pkg:composer/phil/lti-bundle
Requires
- php: >=8.5
- ext-mbstring: *
- ext-sodium: *
- doctrine/dbal: ^4.5
- phil/lti: ^0.1@dev
- phil/safe-http: ^0.2.1@dev
- phil/url: ^0.1.4@dev
- psr/clock: ^1.0
- psr/event-dispatcher: ^1.0
- symfony/config: ^8.2
- symfony/dependency-injection: ^8.2
- symfony/http-foundation: ^8.2
- symfony/routing: ^8.2
- symfony/security-core: ^8.2
- symfony/security-http: ^8.2
- symfony/service-contracts: ^3.6
- twig/twig: ^3.21
Requires (Dev)
- ext-dom: *
- ext-openssl: *
- ext-pdo: *
- doctrine/doctrine-bundle: ^3.3
- doctrine/orm: ^3.7
- phil/ux-kit: >=0.5.0-alpha <1.0
- phpunit/phpunit: ^13.4
- psr/log: ^3.0
- symfony/asset-mapper: ^8.2
- symfony/browser-kit: ^8.2
- symfony/cache: ^8.2
- symfony/clock: ^8.2
- symfony/console: ^8.2
- symfony/css-selector: ^8.2
- symfony/dom-crawler: ^8.1
- symfony/event-dispatcher: ^8.2
- symfony/framework-bundle: ^8.2
- symfony/http-client: ^8.2
- symfony/http-kernel: ^8.2
- symfony/key-management: ^8.2
- symfony/messenger: ^8.2
- symfony/security-bundle: ^8.2
- symfony/translation: ^8.2
- symfony/twig-bundle: ^8.2
- symfony/ux-twig-component: ^3.7
- web-token/jwt-library: ^4.2
Suggests
- doctrine/doctrine-bundle: For the DBAL connection the store "dbal" names
- doctrine/orm: To add the bundle's tables to the schema the ORM generates, and so to its migrations
- symfony/asset-mapper: To serve the Stimulus controller that posts the forms of a launch
- symfony/console: For phil:lti:schema, phil:lti:rotate-keys and phil:lti:purge
- symfony/key-management: To seal the keys the bundle makes and rotates in its table
- symfony/messenger: To send the scores of the tool through a bus, with retries
- symfony/ux-twig-component: For the recipe Button of the kit that the form of a launch shows without scripts
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-16 01:17:52 UTC
README
phil/lti in Symfony: an LTI 1.3 tool, a platform, or both, from one configuration — the routes of the launch, a
security token for each verified launch, the services of LTI Advantage, stores in the database and keys that rotate.
phil/lti-bundle brings phil/lti into a Symfony application:
- as a tool: the routes of the login initiation and of the launch, an authenticator that turns a verified launch into
an
LtiTokencarrying it, an event to answer the launch, the Deep Linking response signed and posted back, and the scores sent to the platform through Messenger, the message carrying an identifier only; - as a platform: the authorization endpoint that signs a launch for the member signed in, the return of Deep Linking, the token endpoint, the Assignment and Grade Services and the Names and Role Provisioning Service over HTTP, and events for the application's gradebook;
- for both: the key set route, the nonces, login states, access tokens, line items, scores and pending scores in
tables of a Doctrine DBAL connection, tested on SQLite, MySQL 8.4 and PostgreSQL 17; the keys made, sealed by Symfony's
KeyManagement and rotated by a command, or read from the environment; the form that posts a launch, drawn with the
recipe
Buttonof the kit and posted by a Stimulus controller.
It is for Symfony applications that open other tools to their learners, or that learning platforms open: a course site, a learning management system, a quiz, a lab, a reading tool.
It is built on what Symfony ships: Config and DependencyInjection for the configuration, Routing and HttpFoundation for the routes, Security for the authenticator, Doctrine DBAL for the stores, KeyManagement for the sealed keys, Messenger for the scores, Twig and the UX Toolkit recipes for the form, AssetMapper and Stimulus for its script.
Status
| Part | State |
|---|---|
Configuration phil_lti: tool, platform or both, registrations, keys, stores |
Implemented and tested |
Tool: login initiation, launch, authenticator and LtiToken, LaunchReceived |
Implemented and tested |
| Tool: Deep Linking response posted back, scores sent through Messenger or at once | Implemented and tested |
| Platform: authorization endpoint, Deep Linking return, token endpoint | Implemented and tested |
| Platform: Assignment and Grade Services, Names and Role Provisioning Service, events | Implemented and tested |
Stores on Doctrine DBAL, the schema listener, phil:lti:schema and phil:lti:purge |
Implemented and tested on SQLite, MySQL 8.4 and PostgreSQL 17 |
Keys sealed by Symfony KeyManagement, rotated by phil:lti:rotate-keys; keys from the environment |
Implemented and tested |
The form of a launch with the recipe Button of the kit, and its Stimulus controller |
Implemented and tested |
| Registrations kept in the database, LTI Dynamic Registration | Planned |
| A gradebook of the platform | Left to the application, which listens to the events |
Documentation
| Document | What it covers |
|---|---|
| Installation | Requirements, the recipe, the routes, the firewalls, the tables, the kit and the assets. |
| Configuration | Every key of phil_lti, with an example. |
| The tool | Launches, the token and the user, answering a launch, Deep Linking, sending scores. |
| The platform | Launches, the application's LaunchMessages, Deep Linking returns, the services and their events. |
| Keys | Keys in the table sealed by the KMS, their rotation, keys from the environment. |
| Storage | The seven tables, their columns and the purge. |
| Security | Firewalls, cookies in frames, the checks of the bundle, and what stays with the application. |
| Extension points | The ports, the events, the services to use, and what stays closed. |
| Testing | The bundle's tests, the servers its integration tests read, and testing an application. |
| Reference | Every class, route, service, command and event of the bundle. |
Quick start
composer require phil/lti-bundle
bin/console doctrine:migrations:diff # the seven tables
bin/console doctrine:migrations:migrate
# config/packages/phil_lti.yaml phil_lti: keys: { source: dbal, master_key: lti } tool: enabled: true platforms: - issuer: 'https://lms.example.org' client_id: '%env(LTI_CLIENT_ID)%' authorization_url: 'https://lms.example.org/lti/authorize' token_url: 'https://lms.example.org/lti/token' key_set_url: 'https://lms.example.org/lti/jwks' deployments: ['1']
use Phil\LtiBundle\Application\Event\LaunchReceived; use Symfony\Component\EventDispatcher\Attribute\AsEventListener; #[AsEventListener] final readonly class OpenTheCourse { public function __invoke(LaunchReceived $event): void { $context = $event->launch->message->context; // set $event->setResponse(...) or let the bundle redirect to the target of the launch } }
Requirements
PHP 8.5 or later with the OpenSSL extension; phil/lti, which signs through web-token/jwt-library, phil/url and
phil/safe-http; Symfony 8.2 Config, DependencyInjection, HttpFoundation,
Routing, Security and Twig; Doctrine DBAL 4. DoctrineBundle, the ORM, Console, KeyManagement, Messenger, AssetMapper
and the UX Twig components are optional: each part is registered when its package is there.
Contributing
Contributions are welcome on the PHIL monorepo: read the contribution guide and the code of conduct. Report a vulnerability privately, as the security policy explains, never in a public issue.
License
MIT, © Philippe Gamache, doing business as Le Gnome Archiviste; a Parler Haut Interagir Librement project. See LICENSE.