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

Upgrade enrol_lti to support LTI v2.0

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      Prerequisites

      You will need two moodle sites. One must be a Moodle 3.2 site (SITE A). The other can be 3.1 or above (SITE B)

      Cartridge Tests
      1. Go to SITE A
      2. Enable the LTI authentication plugin. (Site administration ► Plugins ► Authentication ► Manage authentication)
      3. Then go to Site administration ► Plugins ► Enrolments ► Manage enrol plugins and enable Publish as LTI tool
      4. Create a course and add an activity (e.g. a Page resource).
      5. Under Course administration, click Enrolment methods
      6. Under Add a method select Publish as LTI tool.
      7. Enter a Custom instance name
      8. Under Tool to be published select Course
      9. Click Add method.
      10. Under Course administration, click Published as LTI tools. Take note of the cartridge (or tool) URL and secret to be used later.
      11. Go to SITE B
      12. Log in as admin.
      13. Create a course and enrol some students.
      14. Add an external tool activity.
      15. Enter a name for the activity.
      16. Enter cartridge/tool URL from SITE A into the Launch/cartridge URL field.
      17. Click Show more to expand the form.
      18. Enter any non-empty string value for the Consumer key.
      19. Enter the secret from SITE A into the Shared secret field.
      20. Click Save and return to course.
      21. Login as a student enrolled to the course and open the LTI tool.
        • Confirm that it launches normally.
        • Enter a different cartridge URL from Site A.
        • On SITE B use the same consumer key you used before, and the new secret
        • Ensure it launches correctly.
      Proxy Tests
      1. Go to SITE A
      2. Go to your list of tools
      3. Copy the url in the Proxy URL column for one of the tools
      4. Go to SITE B
      5. Go to Site administration ► Plugins ► External tool ► Manage tools
      6. Paste the url you copied into the box, but don't click add
      7. Change the token part of the url to something else such as "ASDF123"
      8. Click add
      9. Make sure that there is an error displayed
      10. Click cancel
      11. Paste the URL and this time click add with the correct token
      12. Click continue
      13. Click save
      14. The tool should successfully be added.
      15. Go to a course
      16. Add an external tool
      17. Select the type as the tool you just added
      18. Save and display
      19. Verify it works as expected and you log into SITE A correctly
      20. Go to SITE A
      21. Go to your list of tools
      22. Copy the url in the Cartridge URL column for one of the tools
      23. Go to the cartridge
      24. Copy the launch url from the XML
      25. Go to SITE B
      26. Go to Site administration ► Plugins ► External tool ► Manage tools
      27. Paste the url you copied into the box and click add
      28. Make sure you get an error
      29. Go to SITE A
      30. Go to your list of tools
      31. Copy the url in the Proxy URL column for one of the tools
      32. Go to SITE B
      33. Go to Site administration ► Plugins ► External tool ► Manage tools
      34. Paste the url you copied into the box and click add
      35. Make sure it adds correctly
      36. Go to a course
      37. Add an external tool
      38. Paste the proxy URL as the launch url
      39. Confirm you get an error
      40. Edit the tool or make another
      41. Select the new tool type you added
      42. Confirm the tool launches and you are able to do things in SITE A
      Try to hack in
      1. On site A, copy the proxy url of the first tool you shared
      2. Go to site B
      3. Go to Site administration ► Plugins ► External tool ► Manage tools
      4. Paste the proxy url
      5. Follow the registration process, until it's successfully added
      6. Go to SITE A, copy the cartridge url of the second tool you shared
      7. Paste it into your browser
      8. Copy the launch url
      9. Log in to the database of site B
      10. Find the database entry in mdl_lti_types that corresponds to the newly created tool (should have the highest id)
      11. Edit that entry
      12. Paste the launch url of the second tool that you copied before
      13. Go to site B
      14. Go to a course and add an external tool
      15. Select the tool type you added.
      16. Save and display
      17. Ensure you receive an error message.
      18. Go to Site administration ► Plugins ► External tool ► Manage tools
      19. Delete the tool type
      20. Copy the same proxy url from SITE A
      21. Go through the process
      22. Go to your course and select the new type
      23. Save and display
      24. Confirm you can successfully access the tool
      25. Go to site A
      26. Copy the cartridge url of the first tool
      27. Go to a course on site B
      28. Create an external tool
      29. Paste the cartridge url
      30. Copy the secret from site A
      31. invent a consumer key
      32. Go to the site
      33. Edit the tool again
      34. On site A, go to the cartridge url of the second tool and copy the launch url from the xml
      35. Change the launch url to the launch url of the second tool
      36. Try to launch
      37. Make sure you get an error.
      User images
      1. Give your profile a profile image if it doesn't already have one
      2. Apply the patch from MDL-37041 to a new moodle instance (site C)
      3. Go to site A and copy the cartridge url and secret
      4. On site C, create a new external tool instance and paste the cartridge url and secret
      5. View the tool
      6. Refresh the tool (it's not visible the first time. That is a pre-existing bug)
      7. Make sure the user image is visible in the iframe to site A
      8. On site A copy the proxy url
      9. On site C Set it up at Site administration ► Plugins ► External tool ► Manage tools
      10. Add that tool to a course
      11. View the tool
      12. Refresh the tool (it's not visible the first time. That is a pre-existing bug)
      13. Make sure the user image is visible in the iframe to site A
      PHPUnit
      1. Run PHPUnit for enrol_lti on MySQL, Maria DB, PostgreSQL, MSSQL, and Oracle servers.

         vendor/bin/phpunit --testsuite enrol_lti_testsuite
        

        or if using MDK,

        mdk phpunit -r -s enrol_lti
        

        • Confirm that there are no errors nor failures.
      Show
      Prerequisites You will need two moodle sites. One must be a Moodle 3.2 site (SITE A). The other can be 3.1 or above (SITE B) Cartridge Tests Go to SITE A Enable the LTI authentication plugin. (Site administration ► Plugins ► Authentication ► Manage authentication) Then go to Site administration ► Plugins ► Enrolments ► Manage enrol plugins and enable Publish as LTI tool Create a course and add an activity (e.g. a Page resource). Under Course administration, click Enrolment methods Under Add a method select Publish as LTI tool . Enter a Custom instance name Under Tool to be published select Course Click Add method . Under Course administration, click Published as LTI tools . Take note of the cartridge (or tool) URL and secret to be used later. Go to SITE B Log in as admin. Create a course and enrol some students. Add an external tool activity. Enter a name for the activity. Enter cartridge/tool URL from SITE A into the Launch/cartridge URL field. Click Show more to expand the form. Enter any non-empty string value for the Consumer key . Enter the secret from SITE A into the Shared secret field. Click Save and return to course . Login as a student enrolled to the course and open the LTI tool. Confirm that it launches normally. Enter a different cartridge URL from Site A. On SITE B use the same consumer key you used before, and the new secret Ensure it launches correctly. Proxy Tests Go to SITE A Go to your list of tools Copy the url in the Proxy URL column for one of the tools Go to SITE B Go to Site administration ► Plugins ► External tool ► Manage tools Paste the url you copied into the box, but don't click add Change the token part of the url to something else such as "ASDF123" Click add Make sure that there is an error displayed Click cancel Paste the URL and this time click add with the correct token Click continue Click save The tool should successfully be added. Go to a course Add an external tool Select the type as the tool you just added Save and display Verify it works as expected and you log into SITE A correctly Go to SITE A Go to your list of tools Copy the url in the Cartridge URL column for one of the tools Go to the cartridge Copy the launch url from the XML Go to SITE B Go to Site administration ► Plugins ► External tool ► Manage tools Paste the url you copied into the box and click add Make sure you get an error Go to SITE A Go to your list of tools Copy the url in the Proxy URL column for one of the tools Go to SITE B Go to Site administration ► Plugins ► External tool ► Manage tools Paste the url you copied into the box and click add Make sure it adds correctly Go to a course Add an external tool Paste the proxy URL as the launch url Confirm you get an error Edit the tool or make another Select the new tool type you added Confirm the tool launches and you are able to do things in SITE A Try to hack in On site A, copy the proxy url of the first tool you shared Go to site B Go to Site administration ► Plugins ► External tool ► Manage tools Paste the proxy url Follow the registration process, until it's successfully added Go to SITE A, copy the cartridge url of the second tool you shared Paste it into your browser Copy the launch url Log in to the database of site B Find the database entry in mdl_lti_types that corresponds to the newly created tool (should have the highest id) Edit that entry Paste the launch url of the second tool that you copied before Go to site B Go to a course and add an external tool Select the tool type you added. Save and display Ensure you receive an error message. Go to Site administration ► Plugins ► External tool ► Manage tools Delete the tool type Copy the same proxy url from SITE A Go through the process Go to your course and select the new type Save and display Confirm you can successfully access the tool Go to site A Copy the cartridge url of the first tool Go to a course on site B Create an external tool Paste the cartridge url Copy the secret from site A invent a consumer key Go to the site Edit the tool again On site A, go to the cartridge url of the second tool and copy the launch url from the xml Change the launch url to the launch url of the second tool Try to launch Make sure you get an error. User images Give your profile a profile image if it doesn't already have one Apply the patch from MDL-37041 to a new moodle instance (site C) Go to site A and copy the cartridge url and secret On site C, create a new external tool instance and paste the cartridge url and secret View the tool Refresh the tool (it's not visible the first time. That is a pre-existing bug) Make sure the user image is visible in the iframe to site A On site A copy the proxy url On site C Set it up at Site administration ► Plugins ► External tool ► Manage tools Add that tool to a course View the tool Refresh the tool (it's not visible the first time. That is a pre-existing bug) Make sure the user image is visible in the iframe to site A PHPUnit Run PHPUnit for enrol_lti on MySQL, Maria DB, PostgreSQL, MSSQL, and Oracle servers. vendor/bin/phpunit --testsuite enrol_lti_testsuite or if using MDK, mdk phpunit -r -s enrol_lti Confirm that there are no errors nor failures.
    • Affected Branches:
      MOODLE_31_STABLE
    • Fixed Branches:
      MOODLE_32_STABLE
    • Epic Link:
    • Pull Master Branch:
      MDL-53832-master-review-fixes

      Description

      Currently we are not supporting consumers who are using v2. We are also using an unsupported library - so there is an added benefit of upgrading and using a library that is being maintained.

        Attachments

          Issue Links

          There are no Sub-Tasks for this issue.

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  5/Dec/16