Show
Prerequisites
You need two Moodle sites (localhost is fine) - one called 'platform' and one called 'tool'
In the tool site admin settings:
Enable enrol_lti and auth_lti plugins
Enable "Allow frame embedding"
In BOTH sites:
Go to "Administration > Security > HTTP security" and clear all values from the 'curlsecurityblockedhosts' admin setting and save. (to permit localhost-to-localhost calls)
Generate a registration URL (including manual registration URL copy regression testing)
As an admin, in the tool site, go to Admin > Plugins > Enrolment plugins > Publish as LTI tool > Tool registration
Verify you a section called "Registration endpoints", with two tabs, "Dynamic registration" and "Manual registration"
Click the "Manual registration" tab
Now, for each of the URLs present there (Tool, Login, JWKS, Deep linking), verify the following :
You can tab into text field, and doing so selects the entire URL (allowing control + c copying if desired)
You can tab to the clipboard button, at which point the text in the URL is no longer selected
You can hit enter when on the clipboard button to copy the text to clipboard, and you'll see a toast notice at the top of the page describing which field was copied.
You can paste the value copied from clipboard (just paste into a text file somewhere and confirm the URL matches that of the URL on the page)
You can click on the URL text field and that also results in the field being selected (first click only)
Subsequent clicks in a URL field result in a deselection, allowing portions of the URL to be copied (i.e. drag and select whatever text you want)
You can click the clipboard button and that will also result in a "Copied to clipboard" toast notice, just as pressing enter did earlier.
Go back to the "Dynamic registration" tab
Click "Generate registration URL"
Verify :
You see a toast notice saying the URL was generated
You see a URL field with two buttons for "Copy to clipboard" and "Delete"
The "Generate registration URL" button is now disabled.
Mouse over the "Generate registration URL" button and verify you see descriptive text telling you that you must use or delete the existing URL before you can generate another one.
For the dynamic registration URL (the text field + 2 buttons), verify the following .
You can tab into text field, and doing so selects the entire URL (allowing control + c copying if desired)
You can tab to the clipboard button, at which point the text in the URL is no longer selected
You can hit enter when on the clipboard button to copy the text to clipboard, and you'll see a toast notice at the top of the page describing which field was copied.
You can paste the value copied from clipboard (just paste into a text file somewhere and confirm the URL matches that of the URL on the page)
You can click on the URL text field and that also results in the field being selected (first click only)
Subsequent clicks in a URL field result in a deselection, allowing portions of the URL to be copied (i.e. drag and select whatever text you want)
You can click the clipboard button and that will also result in a "Copied to clipboard" toast notice, just as pressing enter did earlier.
Tab into the "Delete" button and hit enter
Verify you're asked to confirm the action
Hit "Cancel" and Verify nothing happens (no change in the page, but the modal closes)
Tab into the "Delete" button and hit enter
Confirm the action
Verify :
You see a toast notice confirming the deletion
The "Generate registration URL" button is once again enabled
Click "Generate registration URL"
Verify you see a new URL created
Repeat this deletion process, this time use click instead of tab+enter. Verify you can delete the registration URL this way too.
Use a registration URL
Generate a registration URL via the admin - as in the first part of the testing.
Copy the value to the clipboard but also paste it into a text file for later use
Now, in the Platform site, go to Admin > Plugins > Activities > External tool > Manage tools
Paste the URL value into the "Tool URL" field
Click "Add LTI Advantage"
Verify :
You see a tool card created below
The tool card needs activation (i.e. says "Pending" and there is an "Activate" button at the bottom of the card)
Activate the tool
Edit the tool, and set " Tool configuration usage" to "Show in activity chooser and as a preconfigured tool"
Save
Now, go to a course and add a new activity, selecting the "Moodle" tool
Click the "Select content" button
Verify you see a modal asking you to login to link your tool account (this confirms the launches are working). Don't proceed.
Log in to the tool site as admin
Go to Admin > Plugins > Enrolment plugins > Publish as LTI tool > Tool registration
Verify you don't see any dynamic registration URL present (it has been used up)
Under "Registered Platforms" below, Verify the following:
You see a single platform registration entry
You see a single deployment for that registration
Use an expired/consumed registration URL
Now, in the Platform site, go to Admin > Plugins > Activities > External tool > Manage tools
Paste the URL value into the "Tool URL" field
Click "Add LTI Advantage". You'll be presented with upgrade options and will see a notice about having multiple tools under the same domain. Just ignore these options.
Click the "Register as a new external tool" button at the bottom of the page.
Verify :
You see an error message stating that the URL is expired or invalid.
Click "Cancel"
Refresh the page
Verify you don't see any new pending tool card.
Dynamic registration in-place update
First, we need to remove any prior registrations from earlier parts of the test:
In the platform site, via admin > manage tools, delete the Moodle preconfigured tool
In the tool site, go to Plugins > Enrolment plugins > Publish as LTI tool > Tool registration
From the Registered Platforms list, delete the ltiplatform entry using the bin/trash icon.
Delete any existing dynamic registration URL
Now, in the tool site, create a new course called "LTI 1.1 Course"
Create an assignment called "Assign 1"
Go to Course settings > Published as LTI tools and click 'Add'
Change the version to "Legacy LTI (1.1/2.0)" and select the "Assign 1" activity
Save
Verify you see the published activity listed under the "Legacy LTI (1.1/2.0)" tab
Copy the Launch URL and Secret (under the launch details column) for later use.
Log out of the tool.
Now, in the platform site, go to Admin > Plugins > Activities > External tool > Manage tools
Click "Configure a tool manually"
Set the following values:
Set Tool name to "1.1 Site level tool"
Set LTI version to "LTI 1.0/1.1"
Paste the Launch URL you copied before into the Tool URL field
Paste the Secret you copied before into the Shared Secret field
Set consumer key to "Consumer_1"
Save the form
Verify you see the tool card listed
Now, log in to the tool site again, and go to Admin > Plugins > Enrolment plugins > Publish as LTI tool > tool registration
Generate a new dynamic registration URL and copy it to the clipboard.
Go back to the ltiplatform site and go to Admin > Plugins > Activities > External tool > Manage tools
Paste the dynamic registration URL into the text field
Click "Add new LTI Advantage"
Verify you're taken to a page listing the "1.1 Site level tool" as an existing tool on the same domain
Click the "Update" button next to the "1.1 site level tool" entry
Now, when you're taken back to the manage tools page, verify :
You see a tool card for "Moodle"
You don't see a tool card for "1.1 Site level tool" (it has been updated in place)