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

Update tool to support 1.3 OAuth2/OIDC launch flow

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Prerequisites

      1. You'll need two Moodle sites running on localhost for this test - one designated 'platform', one 'tool'.
      2. A course called "Platform course 1", in the platform site with:
        • 5 Students: s1, s2, s3, s4, s5
        • 2 Teachers: t1 and t2
      3. A course called "Tool course 1" in the tool site with:
        • An assignment called "Assign 1" with a max grade of 80.
        • An assignment called "Assign 2" with default settings
        • A file resource (representing a non-graded activity)
        • A single teacher, t1, enrolled.
      4. A course called "Tool course 2" in the tool site with:
        • A single teacher t2 enrolled
      5. In the tool site admin settings:
        • Enable enrol_lti and auth_lti plugins
        • Enable "Allow frame embedding"

      Registration

      1. On the tool site, go to Admin > Plugins > Enrolments > Publish as LTI tool > Tool registration
      2. Verify you see two sections: "Tool endpoints" and "Registered" platforms
      3. For each tool endpoint, click the copy link next to it and paste it somewhere.
      4. Verify:
        • You see a notice saying "xxx copied to clipboard", referring to the specific field name
        • The value pasted matches the value of the URL column in the table.
      5. Keep this page open, we'll need it shortly.
      6. On the platform site, go to 'Admin > Plugins > Activity modules > External tool > Manage tools'
      7. Click 'Confgure a tool manually'
      8. Enter the following values:
        • In "Name" enter "Moodle LTI Advantage Tool"
        • Set 'LTI Version' to 1.3
        • Set public key type to 'Keyset URL'
        • In 'Tool URL', paste the value copied from "Tool URL" in the tool.
        • In 'Public keyset' paste the value copied from"JWKS URL" in the tool
        • In 'Initiate login URL', paste the value copied from "Initiate login URL" in the tool
        • In 'Redirection URI(s)' paste the value copied from BOTH "Tool URL" and "Deep linking URL" rows in the tool. Make sure each is on its own line.
        • Check 'Supports deep linking'
        • In 'Content selection URL', paste the value copied from "Deep linking URL" in the tool
        • Under "Services" set "IMS LTI Assignment and Grade Services" to "Use this service for grade sync and column management"
        • Under "Services" set "IMS LTI Names and Role Provisioning" to "Use this service to retrieve members' information as per privacy settings"
        • Set tools settings to "Do not use this service"
        • Set "Tool configuration usage" to "Show in activity chooser and as a preconfigured tool"
      9. Save the tool (you'll be taken to the manage tools page again)
      10. For the tool you just created, click "View configuration details"
      11. Copy these configuration details somewhere, or be ready to access them again.
      12. Now, switch back to the tool site
      13. Under "Registered platforms" click "Register a platform"
      14. Enter the following values:
        • Set "Platform name" to 'Moodle platform'
        • In "Platform Id (Issuer)" paste the value you copied from the "Platform ID" field in the configuration details
        • In "Client ID" paste the value you copied from the "Client ID" field in the configuration details
        • In "Authentication request URL" paste the value you copied from "Authentication request URL" in the configuration details
        • In "Public keyset URL" paste the value you copied from "Public keyset URL" in the configuration details
        • In "Access token URL" paste the value you copied from "Access token URL" in the configuration details
      15. Save changes
      16. Verify:
        • You now see an entry in the Tool site's "Registered Platforms" table.
        • There are no deployments listed under the "Deployments" column of this table.
        • You can see 3 actions: "Edit", "Manage deployments" and "Delete"
      17. Click "Delete"
      18. Cancel and Verify you're taken back to the "Registered platforms" listing
      19. Click "Delete" again
      20. Confirm this time, and Verify the registration is deleted and that you're taken to an empty "Registered platforms" table.
      21. Recreate the registration as per the instructions above, copying all URLs from the configuration details.
      22. Click "Edit" and try editing the fields and saving.
      23. Verify your changes are saved
      24. Revert changes so all URLs match the tool configuration details again
      25. Click "Manage deployments"
      26. Click "Add a deployment"
      27. Set the following values:
        • In "Name" enter "Site wide deployment"
        • In "Deployment Id" paste the value you copied from "Deployment Id" in the the configuration details
      28. Save the deployment
      29. Verify:
        • You see one entry in the "Manage deployments" table
        • The only action available is "Delete".
      30. Click "Delete" to remove the deployment
      31. Cancel, and Verify you're taken back to the listing
      32. Click "Delete" again
      33. Confirm, and Verify the entry is deleted.
      34. Recreate the deployment entry as above, with "Site wide Deployment" and "1" as values.
      35. Go back to "Tool registration" via the breadcrumbs
      36. Verify you see '1' listed under "Deployments" for the single registered platform.
      37. Verify that clicking this '1' takes you to the "Manage deployments" view.
      38. This concludes the registration portion of the testing.

      Simple deep link launch

      1. Log out of the tool site completely
      2. In the platform site, go to a new course
      3. Click to add a new activity, selecting "Moodle LTI Advantage Tool"
      4. When the edit page loads, click the "Select content" button
      5. Verify you see the login page of the tool
      6. Sign in as the teacher 't1' in the tool
      7. Verify you see "No published content was found" in the resulting modal pane. We'll need to publish some resources first.
      8. Go to the tool site's course
      9. From the menu, select "Published as LTI Tools"
      10. Verify:
        • You see a page with 2 tabs: "LTI Advantage" and "Legacy LTI (1.1/2.0" and that "LTI Advantage" is selected by default
        • There is a blue info notification saying "No resources are published yet"
      11. Click the "Legacy LTI" tab
      12. Verify:
        • You see a yellow warning notification saying the 1.1/.2.0 tools are now deprecated.
        • You see a blue info notice stating "No tools provided"
      13. Go back to the "LTI Advantage" tab
      14. Click "Add"
      15. Verify "LTI Version" is set to "LTI Advantage" by default
      16. Enter the following values:
        • Set "Tool to be published" to "Assign 1"
      17. Save
      18. Verify:
        • You're taken back to the "LTI Advantage" tab
        • You now see an entry in the table
        • You can see 'Launch URL' and 'Custom properties' in the "Launch details" column
        • Custom properties is set to something like 'id=some-uuid-value-here'
        • Clicking each field's input in the "Launch details" column selects that whole value, ready for copying to clipboard.
      19. Now, go back to the platform site
      20. Again, click "Select content"
      21. Verify:
        • You are not asked to log in this time (you should still be signed in from the last time)
        • You can see the assignment listed under its parent course.
        • You can see both "Add to course" and "Add to gradebook" check boxes next to "Assign 1"
        • You DO NOT see any checkboxes for the course row itself
      22. Check the "Add to course" checkbox
      23. Verify the "Add to gradebook" checkbox is automatically checked
      24. Uncheck the "Add to course" checkbox
      25. Verify the "Add to gradebook" checkbox is automatically unchecked
      26. Check the "Add to Gradebook" checkbox
      27. Verify the "Add to course" checkbox is automatically checked
      28. Uncheck the "Add to gradebook" checkbox
      29. Verify the "Add to course" checkbox IS NOT unchecked this time.
      30. Make sure no check boxes are selected and submit the form
      31. Verify that the modal closes and no errors are seen
      32. Click "Select content" again
      33. Make sure both checkboxes for "Assign 1" are checked this time
      34. Submit the form
      35. Verify you see:
        • That the mod edit form has been updated, with name set to "Assign 1" now
        • That 'Custom properties' contains a value like 'id=some-uuid-value-here'
        • That the grade has been set to "Point" with "Maxgrade" set to 80, as per the resource's settings in the tool
        • That under "Privacy", "Accept grades from the tool" is checked.
      36. Under privacy check "Share names with the tool" and "Share emails with the tool"
      37. Make sure "Launch container" is set to "Embed" (you may need to click "Show more" to see this option)
      38. Click "Save and return to course"

      Simple resource link launch

      1. Open up a new incognito session and sign in to the tool site as an admin user
      2. Go to the course participants view in this session.
      3. Now go back to your normal platform site session.
      4. As the teacher, in the platform course, click the activity you just created above.
      5. Verify:
        • You can see the assignment in the tool site, as an embedded iframe in your platform site.
        • You can see a navigation bar for the tool site in the iframe (i.e. Embedding is not forced yet)
      6. Reload the participants page in the incognito tab and Verify you see a new user there, complete with email, firstname and surname. Note: This will be IN ADDITION to the existing t1 user who was enrolled there via manual enrolment during test setup.
      7. In the normal platform session, log out of the teacher account
      8. Log in as the student s1
      9. Launch the resource "Assign 1"
      10. Verify:
        • You can see the assignment in the tool site, as an embedded iframe in your platform site.
        • You DO NOT see the nav drawer or nav as part of this view.
      11. Reload the participants page in the incognito tab and Verify you see a new user there, complete with email, firstname and surname. Check these details match those of s1 in the platform site.
      12. As the student, complete the assignment (Submit a file)
      13. Log out of the platform site.
      14. Log in as the teacher
      15. Launch the "Assign 1" resource again from the platform course
      16. Verify that you now see "Participants: 1" in the assign summary, since the student launched into the resource.
      17. Click "View all submissions" and confirm that you see a list containing the student

      Force embedded layout custom property

      1. Continuing on from the "Simple resource link launch" steps from above...
      2. As the teacher in the platform course, edit the activity "Assign 1"
      3. Click "Show more" and under "Custom properties" as "force_embed=true" on a new line of its own
      4. Save
      5. Launch the resource
      6. Verify that you no longer see the navigation drawer or page headers in the embedded tool site. I.e. force_embed is working as expected.
      7. Edit the activity, remove that custom property and save.

      Access control during content selection

      1. Log out of the tool site.
      2. Log in to the platform as user t2
      3. Access the course "Platform course 1"
      4. Click to add new activity and select "Moodle LTI Advantage Tool"
      5. When the edit page loads, click "Select content"
      6. Verify you're asked to sign in to the tool site
      7. Sign in as user t2
      8. Verify you see no published content
      9. Log out of the user t2 in the tool site
      10. Log into the tool site as the admin user
      11. Enrol t2 into "Tool course 1"
      12. Log out of the tool site
      13. In the platform site, press "Select content" again
      14. Again, log in as user t2 in the tool
      15. Verify you now see the published content from "Tool course 1"
      16. As admin user, remove user t2 from the tool course "Tool course 1".

      Manual sharing of resources (and creation of resource links)

      1. Log out of all users in the tool site
      2. Log in as teacher t1 in "Tool course 1"
      3. Click "Published as LTI Tools" in the course cog menu
      4. Note the Launch URL and Custom Properties of "Assign 1". Write these down and pretend you emailed these details to another platform user, t2.
      5. Log out of the tool site.
      6. Log in to the platform site as user t2
      7. Go to the course "Platform course 1"
      8. Click to add an activity, selecting "Moodle LTI Advantage Tool"
      9. When the edit page loads, press "Select content"
      10. Log in as user t2 in the tool when prompted
      11. Verify you see no published resources via the content selection modal. This just verifies that user t2 does not have access to the published resource via content selection.
      12. Close the modal
      13. Enter the Launch URL from the earlier step into the "Tool URL" field
      14. Click "Show more" and enter the Custom properties value from the earlier step into "Custom parameters"
      15. Save
      16. Launch the activity and Verify
        • You can see the assignment in the tool site, as an embedded iframe in your platform site.

      Missing tool deployment

      1. As admin, remove the deployment '1' via 'Admin > Plugins > Enrolments > Tool Registration > Manage deployments'
      2. As the teacher 't1' in the platform, try both content selection and resource link (activity) launches
      3. Verify both fail with an exception "Could not find registration details"
      4. Add the deployment '1' back (you can name it anything)
      5. As the teacher 't1' in the platform, try both content selection and resource link (activity) launches
      6. Verify both now work as before

      Course sharing

      1. Sign in as the teacher 't1' in the tool
      2. Go to the tool site's course "Tool course 1"
      3. From the menu, select "Published as LTI Tools"
      4. Click "Add"
      5. Enter the following values:
        • Set "Tool to be published" to "Tool Course 1"
      6. Save.
      7. Log out of the tool.
      8. Log in to the platform site as user t1
      9. Go to the course "Platform course 1"
      10. Click to create a new resource/activity
      11. Select "Moodle LTI Advantage Tool"
      12. Click "Select content"
      13. Log in to the tool as user t1
      14. Verify:
        • You see checkboxes next to the course "Tool Course 1" for both "Add to course" and "Add to gradebook"
        • You still see checkboxes next to "Assign 1" too.
      15. Make sure both checkboxes for "Tool course 1" are selected and click "Add content"
      16. Submit the form
      17. Verify you see:
        • That the mod edit form has been updated, with name set to "Tool Course 1" now
        • That 'Custom properties' contains a value like 'id=some-uuid-value-here'
        • That the grade has been set to "Point" with "Maxgrade" set to 180 - the summation of "Assign 1" (80 points) and "Assign 2" (100 points).
        • That under "Privacy", "Accept grades from the tool" is checked.
      18. Under privacy check "Share names with the tool" and "Share emails with the tool"
      19. Make sure "Launch container" is set to "Embed" (you may need to click "Show more" to see this option)
      20. Click "Save and return to course"
      21. Verify you see a validation error saying that 180 exceeds the maximum grade value for a resource in the platform (this may not be the case in all platforms but since grade values are sent as a percentage, this won't matter)
      22. Set the grade to 100 and save the activity.
      23. Now, launch the activity you just created.
      24. Verify:
        • You see the course load in an iframe
        • You see the drawer and navigation
      25. Click "Assign 2"
      26. Verify you can view it without any warning/error.
      27. Log out of the tool and platform
      28. Log in to the platform as a student s1
      29. Go to "Tool Course 1"
      30. Launch the shared course activity
      31. Verify:
        • You see the course load in an iframe
        • You see the drawer and navigation
      32. Click "Assign 2"
      33. Verify you can view it without any warning/error.
      34. Log in to the tool site as the teacher t1
      35. Verify:
        • You see the same 2 entries in the participants page for the teacher (t1) and student (s1)
        • That each row (t1, s1) has 2 enrolment methods listed - one for the shared course and one for the shared activity.
      36. Now, go to "Published as LTI tools"
      37. Delete the "Tool Course 1" enrolment method
      38. Confirm the action
      39. Go to the participants page again
      40. Verify:
        • That there are still 2 entries for t1 and s1 in the platform (in addition to the t1 value for the local user).
        • That each row (t1, s1) for the platform users has only one enrolment method listed now - for the "Assign 1" activity.
      41. Log out of the tool and platform.

      Non-graded activities

      1. Log in to the tool site as t1
      2. Go to the course "Tool course 1"
      3. Go to "Published as LTI Tools"
      4. Add new
      5. Select the file resource
      6. Save
      7. Log out of the tool
      8. In the platform, log in as the teacher t1
      9. Go to the platform course "Platform Course 1"
      10. Click to add an activity/resource
      11. Select "Moodle LTI Advantage Tool"
      12. Click "Select content"
      13. Verify:
        • You see the file resource listed under the course "Tool Course 1"
        • The file resource has only a single checkbox "Add to course". There is no checkbox for "Add to gradebook"
      14. Select the file resource checkbox
      15. Click "Add content"
      16. Verify you see:
        • That the mod edit form has been updated, with name set to the name of the file resource
        • That 'Custom properties' contains a value like 'id=some-uuid-value-here'
        • That the grade options have been hidden from the form entirely
        • That under "Privacy", "Accept grades from the tool" is not checked.
      17. Under privacy check "Share names with the tool" and "Share emails with the tool"
      18. Make sure "Launch container" is set to "Embed" (you may need to click "Show more" to see this option)
      19. Click "Save and return to course"
      20. Launch the resource by clicking the activity you just created
      21. Verify you can see the file
      22. Check the course gradebook
      23. Verify there is no grade column for this activity.
      24. Log out of both tool and platform.

      Hiding published resources

      1. Log in to the tool site as t1
      2. Go to the course "Tool course 1"
      3. Go to "Published as LTI Tools"
      4. Next to the "Assign 1" published resource, click the eye to hide it.
      5. In the platform, log in as the teacher t1
      6. Go to the course "Platform Course 1"
      7. Launch the activity that points to the "Assign 1" resource
      8. Verify you see an error saying the resource is unavailable or does not exist.
      9. In the tool, unhide the resource
      10. Launch again in the platform
      11. Verify the launch works without any error.
      12. Log out of the platform and the tool.

      Backup and restore

      1. Log into the tool as the admin user
      2. Go to the course "Tool course 1"
      3. Backup the course
      4. From course settings, select "Restore"
      5. Proceed to restore the course into a new course - name it something like "RESTORE"
      6. Once restored, open the RESTORE course
      7. View the "Published as LTI tools" page
      8. Edit the "Assign 1" published resource
      9. Check the custom properties value of id
      10. Verify this is different to the id of the published "Assign 1" in "Tool course 1"

      Privacy settings

      1. Log in to the platform as teacher t1
      2. Go to course "Platform Course 1"
      3. Edit the settings for lti resource "Assign 1"
      4. Uncheck both "Share emails with the tool" and "Share names with the tool"
      5. Save
      6. Launch the tool
      7. In another tab, log into the tool site as teacher t1
      8. View the course participants page
      9. Verify you see an entry with numeric firstname/surname values and an email that resembles "enrol_lti_eadc1234..@example.com"
      10. In the platform site again as the teacher, edit the activity settings again for "Assign 1"
      11. Launch the resource
      12. Now, back in the tool tab, reload the participants view
      13. Verify:
        • You don't see that pseudo-anonymous entry any more
        • You see an enrolment entry for the teacher t1 from the platform and that firstname, surname and email are all correct.
      Show
      Prerequisites You'll need two Moodle sites running on localhost for this test - one designated 'platform', one 'tool'. A course called "Platform course 1", in the platform site with: 5 Students: s1, s2, s3, s4, s5 2 Teachers: t1 and t2 A course called "Tool course 1" in the tool site with: An assignment called "Assign 1" with a max grade of 80. An assignment called "Assign 2" with default settings A file resource (representing a non-graded activity) A single teacher, t1, enrolled. A course called "Tool course 2" in the tool site with: A single teacher t2 enrolled In the tool site admin settings: Enable enrol_lti and auth_lti plugins Enable "Allow frame embedding" Registration On the tool site, go to Admin > Plugins > Enrolments > Publish as LTI tool > Tool registration Verify you see two sections: "Tool endpoints" and "Registered" platforms For each tool endpoint, click the copy link next to it and paste it somewhere. Verify : You see a notice saying "xxx copied to clipboard", referring to the specific field name The value pasted matches the value of the URL column in the table. Keep this page open, we'll need it shortly. On the platform site, go to 'Admin > Plugins > Activity modules > External tool > Manage tools' Click 'Confgure a tool manually' Enter the following values: In "Name" enter "Moodle LTI Advantage Tool" Set 'LTI Version' to 1.3 Set public key type to 'Keyset URL' In 'Tool URL', paste the value copied from "Tool URL" in the tool. In 'Public keyset' paste the value copied from"JWKS URL" in the tool In 'Initiate login URL', paste the value copied from "Initiate login URL" in the tool In 'Redirection URI(s)' paste the value copied from BOTH "Tool URL" and "Deep linking URL" rows in the tool. Make sure each is on its own line. Check 'Supports deep linking' In 'Content selection URL', paste the value copied from "Deep linking URL" in the tool Under "Services" set "IMS LTI Assignment and Grade Services" to "Use this service for grade sync and column management" Under "Services" set "IMS LTI Names and Role Provisioning" to "Use this service to retrieve members' information as per privacy settings" Set tools settings to "Do not use this service" Set "Tool configuration usage" to "Show in activity chooser and as a preconfigured tool" Save the tool (you'll be taken to the manage tools page again) For the tool you just created, click "View configuration details" Copy these configuration details somewhere, or be ready to access them again. Now, switch back to the tool site Under "Registered platforms" click "Register a platform" Enter the following values: Set "Platform name" to 'Moodle platform' In "Platform Id (Issuer)" paste the value you copied from the "Platform ID" field in the configuration details In "Client ID" paste the value you copied from the "Client ID" field in the configuration details In "Authentication request URL" paste the value you copied from "Authentication request URL" in the configuration details In "Public keyset URL" paste the value you copied from "Public keyset URL" in the configuration details In "Access token URL" paste the value you copied from "Access token URL" in the configuration details Save changes Verify : You now see an entry in the Tool site's "Registered Platforms" table. There are no deployments listed under the "Deployments" column of this table. You can see 3 actions: "Edit", "Manage deployments" and "Delete" Click "Delete" Cancel and Verify you're taken back to the "Registered platforms" listing Click "Delete" again Confirm this time, and Verify the registration is deleted and that you're taken to an empty "Registered platforms" table. Recreate the registration as per the instructions above, copying all URLs from the configuration details. Click "Edit" and try editing the fields and saving. Verify your changes are saved Revert changes so all URLs match the tool configuration details again Click "Manage deployments" Click "Add a deployment" Set the following values: In "Name" enter "Site wide deployment" In "Deployment Id" paste the value you copied from "Deployment Id" in the the configuration details Save the deployment Verify : You see one entry in the "Manage deployments" table The only action available is "Delete". Click "Delete" to remove the deployment Cancel, and Verify you're taken back to the listing Click "Delete" again Confirm, and Verify the entry is deleted. Recreate the deployment entry as above, with "Site wide Deployment" and "1" as values. Go back to "Tool registration" via the breadcrumbs Verify you see '1' listed under "Deployments" for the single registered platform. Verify that clicking this '1' takes you to the "Manage deployments" view. This concludes the registration portion of the testing. Simple deep link launch Log out of the tool site completely In the platform site, go to a new course Click to add a new activity, selecting "Moodle LTI Advantage Tool" When the edit page loads, click the "Select content" button Verify you see the login page of the tool Sign in as the teacher 't1' in the tool Verify you see "No published content was found" in the resulting modal pane. We'll need to publish some resources first. Go to the tool site's course From the menu, select "Published as LTI Tools" Verify : You see a page with 2 tabs: "LTI Advantage" and "Legacy LTI (1.1/2.0" and that "LTI Advantage" is selected by default There is a blue info notification saying "No resources are published yet" Click the "Legacy LTI" tab Verify : You see a yellow warning notification saying the 1.1/.2.0 tools are now deprecated. You see a blue info notice stating "No tools provided" Go back to the "LTI Advantage" tab Click "Add" Verify "LTI Version" is set to "LTI Advantage" by default Enter the following values: Set "Tool to be published" to "Assign 1" Save Verify : You're taken back to the "LTI Advantage" tab You now see an entry in the table You can see 'Launch URL' and 'Custom properties' in the "Launch details" column Custom properties is set to something like 'id=some-uuid-value-here' Clicking each field's input in the "Launch details" column selects that whole value, ready for copying to clipboard. Now, go back to the platform site Again, click "Select content" Verify : You are not asked to log in this time (you should still be signed in from the last time) You can see the assignment listed under its parent course. You can see both "Add to course" and "Add to gradebook" check boxes next to "Assign 1" You DO NOT see any checkboxes for the course row itself Check the "Add to course" checkbox Verify the "Add to gradebook" checkbox is automatically checked Uncheck the "Add to course" checkbox Verify the "Add to gradebook" checkbox is automatically unchecked Check the "Add to Gradebook" checkbox Verify the "Add to course" checkbox is automatically checked Uncheck the "Add to gradebook" checkbox Verify the "Add to course" checkbox IS NOT unchecked this time. Make sure no check boxes are selected and submit the form Verify that the modal closes and no errors are seen Click "Select content" again Make sure both checkboxes for "Assign 1" are checked this time Submit the form Verify you see: That the mod edit form has been updated, with name set to "Assign 1" now That 'Custom properties' contains a value like 'id=some-uuid-value-here' That the grade has been set to "Point" with "Maxgrade" set to 80, as per the resource's settings in the tool That under "Privacy", "Accept grades from the tool" is checked. Under privacy check "Share names with the tool" and "Share emails with the tool" Make sure "Launch container" is set to "Embed" (you may need to click "Show more" to see this option) Click "Save and return to course" Simple resource link launch Open up a new incognito session and sign in to the tool site as an admin user Go to the course participants view in this session. Now go back to your normal platform site session. As the teacher, in the platform course, click the activity you just created above. Verify : You can see the assignment in the tool site, as an embedded iframe in your platform site. You can see a navigation bar for the tool site in the iframe (i.e. Embedding is not forced yet) Reload the participants page in the incognito tab and Verify you see a new user there, complete with email, firstname and surname. Note: This will be IN ADDITION to the existing t1 user who was enrolled there via manual enrolment during test setup. In the normal platform session, log out of the teacher account Log in as the student s1 Launch the resource "Assign 1" Verify: You can see the assignment in the tool site, as an embedded iframe in your platform site. You DO NOT see the nav drawer or nav as part of this view. Reload the participants page in the incognito tab and Verify you see a new user there, complete with email, firstname and surname. Check these details match those of s1 in the platform site. As the student, complete the assignment (Submit a file) Log out of the platform site. Log in as the teacher Launch the "Assign 1" resource again from the platform course Verify that you now see "Participants: 1" in the assign summary, since the student launched into the resource. Click "View all submissions" and confirm that you see a list containing the student Force embedded layout custom property Continuing on from the "Simple resource link launch" steps from above... As the teacher in the platform course, edit the activity "Assign 1" Click "Show more" and under "Custom properties" as "force_embed=true" on a new line of its own Save Launch the resource Verify that you no longer see the navigation drawer or page headers in the embedded tool site. I.e. force_embed is working as expected. Edit the activity, remove that custom property and save. Access control during content selection Log out of the tool site. Log in to the platform as user t2 Access the course "Platform course 1" Click to add new activity and select "Moodle LTI Advantage Tool" When the edit page loads, click "Select content" Verify you're asked to sign in to the tool site Sign in as user t2 Verify you see no published content Log out of the user t2 in the tool site Log into the tool site as the admin user Enrol t2 into "Tool course 1" Log out of the tool site In the platform site, press "Select content" again Again, log in as user t2 in the tool Verify you now see the published content from "Tool course 1" As admin user, remove user t2 from the tool course "Tool course 1". Manual sharing of resources (and creation of resource links) Log out of all users in the tool site Log in as teacher t1 in "Tool course 1" Click "Published as LTI Tools" in the course cog menu Note the Launch URL and Custom Properties of "Assign 1". Write these down and pretend you emailed these details to another platform user, t2. Log out of the tool site. Log in to the platform site as user t2 Go to the course "Platform course 1" Click to add an activity, selecting "Moodle LTI Advantage Tool" When the edit page loads, press "Select content" Log in as user t2 in the tool when prompted Verify you see no published resources via the content selection modal. This just verifies that user t2 does not have access to the published resource via content selection. Close the modal Enter the Launch URL from the earlier step into the "Tool URL" field Click "Show more" and enter the Custom properties value from the earlier step into "Custom parameters" Save Launch the activity and Verify You can see the assignment in the tool site, as an embedded iframe in your platform site. Missing tool deployment As admin, remove the deployment '1' via 'Admin > Plugins > Enrolments > Tool Registration > Manage deployments' As the teacher 't1' in the platform, try both content selection and resource link (activity) launches Verify both fail with an exception "Could not find registration details" Add the deployment '1' back (you can name it anything) As the teacher 't1' in the platform, try both content selection and resource link (activity) launches Verify both now work as before Course sharing Sign in as the teacher 't1' in the tool Go to the tool site's course "Tool course 1" From the menu, select "Published as LTI Tools" Click "Add" Enter the following values: Set "Tool to be published" to "Tool Course 1" Save. Log out of the tool. Log in to the platform site as user t1 Go to the course "Platform course 1" Click to create a new resource/activity Select "Moodle LTI Advantage Tool" Click "Select content" Log in to the tool as user t1 Verify : You see checkboxes next to the course "Tool Course 1" for both "Add to course" and "Add to gradebook" You still see checkboxes next to "Assign 1" too. Make sure both checkboxes for "Tool course 1" are selected and click "Add content" Submit the form Verify you see: That the mod edit form has been updated, with name set to "Tool Course 1" now That 'Custom properties' contains a value like 'id=some-uuid-value-here' That the grade has been set to "Point" with "Maxgrade" set to 180 - the summation of "Assign 1" (80 points) and "Assign 2" (100 points). That under "Privacy", "Accept grades from the tool" is checked. Under privacy check "Share names with the tool" and "Share emails with the tool" Make sure "Launch container" is set to "Embed" (you may need to click "Show more" to see this option) Click "Save and return to course" Verify you see a validation error saying that 180 exceeds the maximum grade value for a resource in the platform (this may not be the case in all platforms but since grade values are sent as a percentage, this won't matter) Set the grade to 100 and save the activity. Now, launch the activity you just created. Verify : You see the course load in an iframe You see the drawer and navigation Click "Assign 2" Verify you can view it without any warning/error. Log out of the tool and platform Log in to the platform as a student s1 Go to "Tool Course 1" Launch the shared course activity Verify : You see the course load in an iframe You see the drawer and navigation Click "Assign 2" Verify you can view it without any warning/error. Log in to the tool site as the teacher t1 Verify : You see the same 2 entries in the participants page for the teacher (t1) and student (s1) That each row (t1, s1) has 2 enrolment methods listed - one for the shared course and one for the shared activity. Now, go to "Published as LTI tools" Delete the "Tool Course 1" enrolment method Confirm the action Go to the participants page again Verify : That there are still 2 entries for t1 and s1 in the platform (in addition to the t1 value for the local user). That each row (t1, s1) for the platform users has only one enrolment method listed now - for the "Assign 1" activity. Log out of the tool and platform. Non-graded activities Log in to the tool site as t1 Go to the course "Tool course 1" Go to "Published as LTI Tools" Add new Select the file resource Save Log out of the tool In the platform, log in as the teacher t1 Go to the platform course "Platform Course 1" Click to add an activity/resource Select "Moodle LTI Advantage Tool" Click "Select content" Verify : You see the file resource listed under the course "Tool Course 1" The file resource has only a single checkbox "Add to course". There is no checkbox for "Add to gradebook" Select the file resource checkbox Click "Add content" Verify you see: That the mod edit form has been updated, with name set to the name of the file resource That 'Custom properties' contains a value like 'id=some-uuid-value-here' That the grade options have been hidden from the form entirely That under "Privacy", "Accept grades from the tool" is not checked. Under privacy check "Share names with the tool" and "Share emails with the tool" Make sure "Launch container" is set to "Embed" (you may need to click "Show more" to see this option) Click "Save and return to course" Launch the resource by clicking the activity you just created Verify you can see the file Check the course gradebook Verify there is no grade column for this activity. Log out of both tool and platform. Hiding published resources Log in to the tool site as t1 Go to the course "Tool course 1" Go to "Published as LTI Tools" Next to the "Assign 1" published resource, click the eye to hide it. In the platform, log in as the teacher t1 Go to the course "Platform Course 1" Launch the activity that points to the "Assign 1" resource Verify you see an error saying the resource is unavailable or does not exist. In the tool, unhide the resource Launch again in the platform Verify the launch works without any error. Log out of the platform and the tool. Backup and restore Log into the tool as the admin user Go to the course "Tool course 1" Backup the course From course settings, select "Restore" Proceed to restore the course into a new course - name it something like "RESTORE" Once restored, open the RESTORE course View the "Published as LTI tools" page Edit the "Assign 1" published resource Check the custom properties value of id Verify this is different to the id of the published "Assign 1" in "Tool course 1" Privacy settings Log in to the platform as teacher t1 Go to course "Platform Course 1" Edit the settings for lti resource "Assign 1" Uncheck both "Share emails with the tool" and "Share names with the tool" Save Launch the tool In another tab, log into the tool site as teacher t1 View the course participants page Verify you see an entry with numeric firstname/surname values and an email that resembles "enrol_lti_eadc1234..@example.com" In the platform site again as the teacher, edit the activity settings again for "Assign 1" Launch the resource Now, back in the tool tab, reload the participants view Verify : You don't see that pseudo-anonymous entry any more You see an enrolment entry for the teacher t1 from the platform and that firstname, surname and email are all correct.
    • Affected Branches:
      MOODLE_311_STABLE, MOODLE_400_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-69543-master
    • Story Points:
      0
    • Sprint:
      4.0 holding pattern 5, 4.0 holding pattern 12, 4.0 Navigation blitz, 4.0 Navigation blitz 2, 4.0 Navigation blitz 3

      Description

      Per the specs:

      https://www.imsglobal.org/spec/lti/v1p3#tool-deployment-0
      http://www.imsglobal.org/spec/security/v1p0/#step-1-third-party-initiated-login

      Reference library from IMS (requires php7.3 iirc)
      https://github.com/IMSGlobal/lti-1-3-php-library

       

      This will involve adding several new fields to store relevant platform information in the tool as well as to store keys needed for the auth flow. Dynamic registration does not need to be supported at this time as support is not present in core's platform implementation yet.

      At the end of this work, we should be able to launch a tool via the OIDC third party initiated login flow and provide basic user information to the tool via JWT.
      This issue deals with primarily the auth flow. Another issue will be created to deal with user enrolments/auth of the specific user launching the tool (MDL-69547)

      Some work has been done on this, so this will be about formalising that solution and working through any blockers.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 8 weeks
                  8w