Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-69862

Add dynamic registration support to the tool

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Minor
    • Resolution: Done
    • Affects Version/s: 4.0
    • Fix Version/s: None
    • Component/s: LTI provider
    • Affected Branches:
      MOODLE_400_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-69862-master
    • Testing Instructions:
      Hide

      Prerequisites

      1. You need two Moodle sites (localhost is fine) - one called 'platform' and one called 'tool'
      2. In the tool site admin settings:
        • Enable enrol_lti and auth_lti plugins
        • Enable "Allow frame embedding"
        • Go to "Administration > Security > HTTP security" and leave empty the curlsecurityblockedhosts field (to permit localhost-to-localhost calls)

      Generate a registration URL (including manual registration URL copy regression testing)

      1. As an admin, in the tool site, go to Admin > Plugins > Enrolment plugins > Publish as LTI tool > Tool registration
      2. Verify you a section called "Registration endpoints", with two tabs, "Dynamic registration" and "Manual registration"
      3. Click the "Manual registration" tab
      4. 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.
      5. Go back to the "Dynamic registration" tab
      6. Click "Generate registration URL"
      7. 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.
      8. 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.
      9. Tab into the "Delete" button and hit enter
      10. Verify you're asked to confirm the action
      11. Hit "Cancel" and Verify nothing happens (no change in the page, but the modal closes)
      12. Tab into the "Delete" button and hit enter
      13. Confirm the action
      14. Verify:
        • You see a toast notice confirming the deletion
        • The "Generate registration URL" button is once again enabled
      15. Click "Generate registration URL"
        • Verify you see a new URL created
      16. 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

      1. Generate a registration URL via the admin - as in the first part of the testing.
      2. Copy the value to the clipboard but also paste it into a text file for later use
      3. Now, in the Platform site, go to Admin > Plugins > Activities > External tool > Manage tools
      4. Paste the URL value into the "Tool URL" field
      5. Click "Add LTI Advantage"
      6. 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)
      7. Activate the tool
      8. Edit the tool, and set " Tool configuration usage" to "Show in activity chooser and as a preconfigured tool"
      9. Save
      10. Now, go to a course and add a new activity, selecting the "Moodle" tool
      11. Click the "Select content" button
      12. Verify you see a modal with the text "Published Content: No resources or activities are published yet" (this confirms the launches are working)
      13. Log in to the tool site as admin
      14. Go to Admin > Plugins > Enrolment plugins > Publish as LTI tool > Tool registration
      15. Verify you don't see any dynamic registration URL present (it has been used up)
      16. 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

      1. Now, in the Platform site, go to Admin > Plugins > Activities > External tool > Manage tools
      2. Paste the URL value into the "Tool URL" field
      3. Click "Add LTI Advantage"
      4. Click the "Register as a new external tool" button
      5. Verify:
        • You see an error message stating that the URL is expired or invalid.
      6. Click "Cancel"
      7. Refresh the page
      8. Verify you don't see any new pending tool card.

      Dynamic registration in-place update

      1. 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
      2. Now, in the tool site, create a new course called "LTI 1.1 Course"
      3. Create an assignment called "Assign 1"
      4. Go to Course settings > Published as LTI tools and click 'Add'
      5. Change the version to "Legacy LTI (1.1/2.0)" and select the "Assign 1" activity
      6. Save
      7. Verify you see the published activity listed under the "Legacy LTI (1.1/2.0)" tab
      8. Copy the Launch URL and Secret (under the launch details column) for later use.
      9. Log out of the tool.
      10. Now, in the platform site, go to Admin > Plugins > Activities > External tool > Manage tools
      11. Click "Configure a tool manually"
      12. 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"
      13. Save the form
      14. Verify you see the tool card listed
      15. Now, log in to the tool site again, and go to Admin > Plugins > Enrolment plugins > Publish as LTI tool > tool registration
      16. Generate a new dynamic registration URL and copy it to the clipboard.
      17. Go back to the ltiplatform site and go to Admin > Plugins > Activities > External tool > Manage tools
      18. Paste the dynamic registration URL into the text field
      19. Click "Add new LTI Advantage"
      20. Verify you're taken to a page listing the "1.1 Site level tool" as an existing tool on the same domain
      21. Click the "Update" button next to the "1.1 site level tool" entry
      22. 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)
      23. Edit the "Moodle" tool settings
      24. Verify
        • "This is an upgraded legacy tool" is checked
        • "Legacy consumer key" is set to "Consumer_1"
        • "Legacy shared secret" is set to the value you used earlier when setting up the 1.1 tool (just show using the eye to confirm it has a value)
      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" Go to "Administration > Security > HTTP security" and leave empty the curlsecurityblockedhosts field (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 with the text "Published Content: No resources or activities are published yet" (this confirms the launches are working) 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" Click the "Register as a new external tool" button 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) Edit the "Moodle" tool settings Verify "This is an upgraded legacy tool" is checked "Legacy consumer key" is set to "Consumer_1" "Legacy shared secret" is set to the value you used earlier when setting up the 1.1 tool (just show using the eye to confirm it has a value)
    • Story Points:
      1
    • Sprint:
      Navigation push 2, Navigation push 3, Navigation push 4, Navigation push 5, Navigation push 6

      Description

      See MDL-67301, which adds support for dynamic registration to the platform side of things, in mod/lti. This issue is about implementing the tool side, allowing the Moodle tool to be registered via one action in any dynamic-registration-compliant platforms.

      The IMS spec is not yet public, however if/when it becomes available, I will link it here.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jaked Jake Dallimore
              Reporter:
              jaked Jake Dallimore
              Peer reviewer:
              Mihail Geshoski Mihail Geshoski
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 week, 4 days, 6 hours, 24 minutes
                  1w 4d 6h 24m