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

LtiLinkMemberships URL is invalid in 3.5 and higher

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. Download ngrok if you don't have it from https://ngrok.com/.
      2. Run ngrok (eg. ./ngrok http 80 --region=au).
      3. Change your wwwroot to use the https URL.
      4. Add $CFG->sslproxy = true to your config.php.
      5. Visit 'Site administration' > 'Plugins' > 'Activity modules' > 'External tool' > 'Manage tools'.
      6. Click on 'Manage external tool registrations'.
      7. Click on 'Configure a new external tool registration'.
      8. Set the 'Tool provider name' to 'GreeveyBoy'.
      9. Set the 'Registration URL' to 'https://www.tsugi.org/lti-test/tp.php'.
      10. Select all 'Capabilities'.
      11. Select all 'Services'.
      12. Click 'Save changes'.
      13. Click on the tick next to the tool registration you just added.
      14. Once the page has loaded click on the link 'Continue to launch_presentation_url'.
      15. Visit 'Site administration' > 'Plugins' > 'Activity modules' > 'External tool' > 'Manage tools'.
      16. Activate the tool.
      17. Edit the tool.
      18. Add the custom parameter, ltilink_memberships_url=$LtiLink.memberships.url.
      19. Visit a course.
      20. Add an 'External tool' activity.
      21. Select the tool you added in the 'Preconfigured tool' drop-down.
      22. Click 'Save and return to course'.
      23. Click on the activity you added.
        1. Confirm that the value in the "custom_ltilink_memberships_url" launch parameter is an actual URL
          Note: It SHOULD NOT be literally "custom_ltilink_memberships_url=$LtiLink.memberships.url" but instead soemthing like:
          custom_ltilink_memberships_url=https://foo.au.ngrok.io/im/...
      Show
      Download ngrok if you don't have it from https://ngrok.com/ . Run ngrok (eg. ./ngrok http 80 --region=au). Change your wwwroot to use the https URL. Add $CFG->sslproxy = true to your config.php. Visit 'Site administration' > 'Plugins' > 'Activity modules' > 'External tool' > 'Manage tools'. Click on 'Manage external tool registrations'. Click on 'Configure a new external tool registration'. Set the 'Tool provider name' to 'GreeveyBoy'. Set the 'Registration URL' to 'https://www.tsugi.org/lti-test/tp.php'. Select all 'Capabilities'. Select all 'Services'. Click 'Save changes'. Click on the tick next to the tool registration you just added. Once the page has loaded click on the link 'Continue to launch_presentation_url'. Visit 'Site administration' > 'Plugins' > 'Activity modules' > 'External tool' > 'Manage tools'. Activate the tool. Edit the tool. Add the custom parameter, ltilink_memberships_url=$LtiLink.memberships.url . Visit a course. Add an 'External tool' activity. Select the tool you added in the 'Preconfigured tool' drop-down. Click 'Save and return to course'. Click on the activity you added. Confirm that the value in the "custom_ltilink_memberships_url" launch parameter is an actual URL Note: It SHOULD NOT be literally " custom_ltilink_memberships_url=$LtiLink.memberships.url " but instead soemthing like: custom_ltilink_memberships_url= https://foo.au.ngrok.io/im/ ...
    • Affected Branches:
      MOODLE_35_STABLE
    • Fixed Branches:
      MOODLE_35_STABLE
    • Pull from Repository:
    • Pull 3.5 Branch:
    • Pull Master Branch:
      MDL-62969_master

      Description

      Per this conversation with Claude Vervoort, the value passed in custom_ltilink_memberships_url to an LTI 2.0 tool provider is invalid.

      It is expected to be the endpoint for LtiLinkMemberships.url, but is returned as "$LtiLinkMemberships.url". While the LTI specification no longer includes mention of the LtiLinkMemberships URL, this is a regression that affects existing LTI 2.0 tool providers using the URL.

      The actual bug is a typo in the parse_value function. It should read:

      if (strpos($value, '$LtiLink.memberships.url') !== false) {

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  10/Sep/18

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 30 minutes
                  30m