Publish as LTI tool
Moodle as an LTI provider
The 'Publish as LTI tool' enrolment plugin, together with the LTI authentication plugin, allows remote users on a different platform to access selected courses and activities. In other words, Moodle functions as an LTI tool. Courses and activities can be completed by accessing them from the remote platform. When grades are recorded, these will also be sent back to the remote platform.
LTI 1.3 and LTI Advantage
LTI 1.3 describes the core specification needed for securely launching a Tool resource from within a Platform. When the core LTI 1.3 functionality is packaged alongside the three essential services (Assignment and Grade Services v2.0, Names and Role Provisioning Services v2.0 and Deep Linking v2.0), it's called LTI Advantage. More information about LTI Advantage and its services can be found on the IMS Global website. See https://www.imsglobal.org/activity/learning-tools-interoperability.
With LTI Advantage, the term 'Tool' is used to refer to the external service providing functionality, while 'Platform' is used to refer to the application wanting to use the functionality provided by the tool. The terms 'Platform' and 'Tool' can be thought of as replacements for the legacy terms 'Consumer' and 'Provider' respectively.
Enabling the 'Publish as LTI tool' feature
An administrator can enable the 'Publish as LTI tool' for use across the site:
- Go to Site administration > Plugins > Authentication > Manage authentication and enable LTI
- Go to Site administration > Plugins > Enrolments > Manage enrol plugins and enable 'Publish as LTI tool'
It is recommended that the site administration setting 'Allow frame embedding' is enabled (in "Site Administration > Security > HTTP security") so that tools can be displayed within a frame rather than in a new window, if desired.
Register Moodle with the platform
The security model for LTI 1.3 and LTI Advantage services is based on OAuth 2.0 and OpenID Connect. This differs from previous versions of the LTI standard, which used OAuth 1.0. Practically, this means the Tool and Platform must register with one another ahead of time, before activities and courses can be accessed from the platform. This also means that the use of 'consumer key' and 'consumer secret' to secure access to resource is no longer required. Registration happens only once, when setting up a link between the tool and a platform, and is essentially a security contract between those two respective systems.
Registration can be completed one of several ways:
- Manual registration - A manual exchange of URLs and IDs between the platform and tool performed by an admin user.
- Dynamic registration - Exchange of the relevant URLs and IDs is automated. The platform uses the tool's registration URL to begin this process.
Dynamic registration simplifies the configuration process for administrators significantly and should be preferred, provided it is supported by the platform. Manual registration will work on any LTI Advantage compliant platforms, so is the natural choice when the platform doesn't yet support dynamic registration.
Regardless of the registration method, the first step is always to create a platform registration via Site administration.
Dynamic Registration
In the Moodle tool:
- As an admin user, go to "Site administration > Plugins > Enrolments > Publish as LTI tool > Tool registration"
- Click the "Register a platform" button to create a new platform registration
- Enter the name of the platform and click "Continue"
- When presented with the "Tool details" tab, click to copy the Registration URL under the "Dynamic registration" section
In the platform:
The exact method of using a registration URL is platform-dependent.
In Moodle (for Moodle-to-Moodle LTI):
- As an admin user, go to "Site administration > Plugins > Activity modules > External tool > Manage tools"
- Paste the registration URL into the "Tool URL" field
- Click "Add LTI Advantage"
- If prompted, select "Register as a new external tool" (you will only be prompted if another Moodle tool from the same domain is already configured on the platform)
- When the page reloads and the tool card is visible, click "Activate".
Once complete, platform details and an associated deployment id will have been automatically added to the registration in the Moodle tool. To see this, go to "Site administration > Plugins > Enrolments > Publish as LTI tool > Tool registration". You'll see the updated registration listed as "Active". Clicking the "View platform details" action will display the relevant platform information, while the "Manage deployments" action will allow you to add or remove deployments. No changes to either of these sections are required, however.
Manual registration
There are two parts to the manual registration process. Firstly, it requires information be copied from the Moodle tool into the platform, as part of configuring the tool there. Finally it requires information about the tool configuration in the platform be copied into the Moodle tool site to complete the process.
Starting in the Moodle tool:
- As an admin user, go to "Site administration > Plugins > Enrolments > Publish as LTI tool > Tool registration"
- Click the "Register a platform" button to create a new platform registration
- Enter the name of the platform and click "Continue"
- You'll see a "Tool details" tab. Leave this browser window open.
Now, in the platform (the exact setup is platform dependent but this guide assumes another Moodle site is being used as the platform):
- As an admin user, go to "Site administration > Plugins > Activity modules > External tool > Manage tools"
- Click "Configure a tool manually"
- Change the field "LTI version" to "LTI 1.3"
- Change "Public key type" to "Keyset URL"
- Enable "Supports Deep Linking (Content-Item Message)"
- Copy the following URLs from the tool site into the respective form fields on the platform site:
- Copy "Tool URL" into both the "Tool URL" field and the "Redirection URI(s)" field
- Copy "Initiate login URL" into the "Initiate login URL" field
- Copy "JWKS URL" into the "Public keyset" field
- Copy "Deep linking URL" into both the "Content selection URL" field and the "Redirection URI(s)" field (on a new line)
- Set a tool name and save the configuration.
- On the resulting tool card, click "View configuration details" and leave this browser window open
Now, back in the Moodle tool again:
- As the admin user, go to "Site administration > Plugins > Enrolments > Publish as LTI tool > Tool registration"
- If you have the registration open still, simply click the "Platform details" tab. If not, from the registration table, click the "View platform details" action. You'll see a table listing the various platform endpoints and identifiers.
- Click "Edit platform details"
- Copy the following values from the platform site's tool configuration into the respective form fields:
- Copy "Platform ID" into the "Platform ID (issuer)" field
- Copy "Client ID" into the "Client ID" field
- Copy "Public keyset URL" into the "Public keyset URL" field
- Copy "Access token URL" into the "Access token URL" field
- Copy "Authentication request URL" into the "Authentication request URL" field
- Save
- Next, select the "Deployments" tab
- Click "Add a deployment"
- Copy the "Deployment ID" from the platform site's tool configuration into the "Deployment ID" field
- Enter a deployment name and save.
The registration process is now complete. Click the "Back" button or navigate to "Site administration > Plugins > Enrolments > Publish as LTI tool > Tool registration", where you will now see the registration listed as "Active".
Sharing access to a course or activity
- From the course navigation, select "Published as LTI tools"
- Under the "LTI Advantage" tab (this is selected by default) click the "Add" button
- In "Tool to be published" select the course or activity to be shared
- Enable grade and user sync for the resource, if required
- Click the "Add method" button
The published activity or course is now ready for use in platforms via the content selection flow.
Note: The fields "Launch URL" and "Custom properties" are only relevant when sharing the content with instructors who don't have an account in the Moodle tool. If you're using Content selection, you can ignore these values.
Grade and user synchronisation (if configured) is handled asynchronously via the 'Publish as LTI tool grade sync' and 'Publish as LTI tool users sync' scheduled tasks, which run by default every 30 minutes.
If user synchronisation is set to yes, enrolled users in the remote system are synchronised with enrolments in the course, with an account created for each remote user as necessary, and the user enrolled or unenrolled as required. If set to no, at the moment when a remote user accesses the tool, an account will be created for them and they will be automatically enrolled.
User account provisioning
When users access a shared activity or course for the first time, Moodle will need to either find an existing account or create an account for them. Historically, all first launches resulted in the creation of new user accounts in Moodle, meaning users with existing accounts had no way to reuse those accounts. Account provisioning modes solve this problem by providing control over how accounts are created or linked on first launch. Additionally, in the case of teachers, they permit a richer experience via Content Selection, a process allowing the teacher to launch into Moodle using their existing Moodle account and select from any shared course or activity they have access to. More on this in the next section.
There are two relevant settings in the published resource settings; "Student first launch provisioning mode" and "Teacher first launch provisioning mode". Each setting controls how Moodle will handle the first launch for a user of that particular role (the role assigned to the user in the platform from which they launch the tool). Currently, several modes are supported:
- New accounts only (automatic) - A new account will automatically be created for the user during first launch. This account will then be reused on subsequent launches.
- Existing and new accounts (prompt) - The user will be prompted to either link an existing account they have in Moodle, or have a new account created for them. Subsequent launches will use whichever account is the result of this choice.
- Existing accounts only (prompt) - Only existing accounts may be used. If the user does not have an existing Moodle account to use, they will be unable to access the shared resources.
By default, "Teacher first launch provisioning mode" is set to "Existing and new accounts (prompt)", granting teachers flexibility in how they access the tool resources. Those having accounts can choose to use their existing account, while those not having an account can opt for the latter.
The default for "Student first launch provisioning mode" is "New accounts only (automatic)". Students will have accounts created for them automatically during first launch.
Content selection launches (Deep linking) require an existing account in Moodle, so always use "Existing accounts only (prompt)". Users without an account in Moodle cannot use this feature.
Each setting can be changed for each published resource, however, with a caveat. Once a user account is linked to a platform user, subsequent launches by that platform user will use that linked account. If a user accesses one resource using 'automatic' provisioning mode, and then later launches another resource which permits the use of existing accounts, the user will not be prompted to sign in because an account is already associated with them (the account which was automatically created for them during the first launch). The same is not true for the reverse situation. If the user accesses a resource permitting the use of existing accounts first, their existing account can be linked. Subsequently accessing a resource using 'automatic' provisioning mode, will only result in the reuse of their existing (now linked) account, and not the creation of a new account.
On the LTI platform site
Different platforms have different means of configuring and using LTI tools. The preferred means of configuring a course or activity link is by using Deep Linking (Content Selection), however, this requires that instructors have an existing account on the Moodle tool site. In instances where this isn't the case, course or activity links can be manually configured in the platform. Both methods are described below.
Link creation via content selection
The following describes the recommended process for teachers when using another Moodle site as the platform and assumes the tool-platform registration process has already been completed. More information on the Moodle external tool setup can be found at External tool.
- Make sure you're signed in to the Moodle tool site in another browser tab (if not, you will be prompted to do so later)
- In the platform site, visit a course
- Add an External Tool activity, or select a pre-configured tool from the activity chooser.
- Click the "Select content" button
- When prompted, link your account
- Select from a list of activities and courses to which you have access (optionally adding line items to the platform gradebook, where applicable - see note below), clicking "Add content" when done
- Save and launch the activity
Note: For platforms supporting coupled line items, Moodle can send information about the activity's grade to the platform during content selection. This allows the platform to create the respective line item in its grade book at the time of link creation. Whether this information is returned to the platform or not depends on two things: whether the published course or activity supports grades, and whether the 'Add to gradebook' checkbox is ticked during content selection.
Manual link creation
For users who don't have an account on the Moodle tool site, content selection isn't possible. These users can manually configure the activity link in the platform via the following process. Again, this assumes the tool-platform registration process has already been completed.
- In the platform site, visit a course
- Add an External Tool activity, or select a pre-configured tool from the activity chooser.
- Click "Show more"
- Enter the published course or activity's "Launch URL" into the "Tool URL" field
- Enter the published course or activity's "Custom properties" into the "Custom parameters" field
- Save and launch the activity
Custom launch parameters
Note: If you would prefer to not show blocks for teachers, you can pass the custom parameter "force_embed = 1". This may limit the functionality available to teachers and admins. To get blocks back, simply remove the parameter.
LTI Advantage, LTI 1.1 or LTI 2.0?
Moodle supports publication of content over several IMS LTI standards; LTI Advantage, LTI 1.1 and LTI 2.0. LTI Advantage is the current standard; LTI 1.1 and 2.0 have been deprecated. Courses and activities should be published using LTI Advantage. The legacy publication methods will continue to function in their current state to allow organisations to progressively move to LTI Advantage and will be removed in the future. More information about legacy methods can be found in the "Legacy resources" section below.
Legacy resources
The following resources pertain to now deprecated versions of LTI (1.1 and 2.0).
Sharing access to a course or activity (LTI 1.1 and 2.0)
- Go to the 'Enrolment methods' page and add 'Publish as LTI tool' as an enrolment method
- In 'Tool to be published' select the course or activity to be shared
- Click the 'Add method' button
- Go to Course Administration > Published as LTI tools page (/enrol/lti/index.php?courseid=n) and make a note of the launch details or the registration URL for the LTI consumer site (see below for info on which to choose). The URL will be of the form: .../enrol/lti/...
- You will also need to give the LTI consumer site a consumer key - this can be anything you want.
The LTI consumer can be another Moodle site or any other LTI-consumer-compliant LMS. Depending on the requirements of the LTI consumer, you can provide either a cartridge URL (also called configuration URL) plus secret OR a launch URL (new in Moodle 3.5.2) OR a registration URL.
Grade and user synchronisation follow the same rules as with LTI 1.3 and LTI Advantage publishing.
Comparison of LTI 1.1 and 2.0 terms across platforms
IMS Spec | Moodle | Canvas | Edu app center (Canvas) | Desire2Learn | Blackboard | Sakai | Chamilo |
---|---|---|---|---|---|---|---|
Tool consumer | External Tool | External App | App | Link | LTI Tool provider* | Sakai Basic LTI portlet | IMS/LTI Plugin |
Launch URL | Tool URL | Launch URL | n/a | URL | Provider Domain | Remote Tool URL | Launch URL |
Secret | Secret | Secret | Secret | Secret | Tool Provider Secret | Remote tool secret | Secret |
Cartridge URL | Tool URL | Paste XML | Configuration URL | n/a | n/a | Tool registration file? | n/a |
Proxy URL | Registration URL/Tool URL | LTI 2 Registration URL | n/a | n/a | n/a | - | n/a |
Common issues
The setup of LTI can be tricky, these are some of the most frequently reported issues by Moodle users. As always, enabling debug information can help trace the roots of a problem.
LTI 1.1 and 2.0 Common issues
Mixed protocol limitations
If your Moodle instance is using HTTP (and not HTTPS) you will only be able to use the tool on sites that are also using HTTP (and not HTTPS). It's recommended that you use HTTPS on your Moodle instance. See Transitioning to HTTPS.
A required parameter (oauth_consumer_key) was missing
This exception occurs when the Tool Consumer is missing a Consumer Key parameter. As mentioned above, the consumer key can be anything you want so long as the field isn't left empty. Best keep it simple and without special characters, however.
User has free access to the entire site, isn't contained to the course
This can happen when the course content isn't embedded. Enable Allow frame embedding in Site Administration > Security > HTTP Security and, on the consumer site LTI tool settings, add force_embed=1 in the custom parameters settings.
This XML file does not appear to have any style information associated with it.
Some tool consumers do not support cartridge URLs such as Sakai and Chamilo, in that case, it's better to use the launch URL.
Invalid request
This exception can happen for various reasons, so it can be difficult to trace the root of the problem. One of the possibilities is that deep linking is enabled in the tool consumer. Disabling it can help in LMS that have it like Chamilo and Canvas.
See also
Any further questions?
Please post in the LTI and Moodle forum on moodle.org