Hide
Prerequisites
1. This needs to be tested in the following browsers:
- Chrome - with the --test-third-party-cookie-phaseout flag (you can set this by going to chrome://flags in the URL, then looking for 'cookies' - it'll be an option in the results there).
- Chrome - current vanilla settings, i.e. without the flag
- Firefox - vanilla settings
- Safari - vanilla settings
Please make sure you have access to these.
2. This needs to be tested using 2 public HTTPS sites on different domains. So, please make sure you can publish your dev sites using something like ngrok, localtunnel, expose, etc. etc.
3. You need two Moodle sites - one called 'platform' and one called 'tool':
- In the tool site admin settings:
- Enable enrol_lti and auth_lti plugins
- Enable "Allow frame embedding"
- Make both sites public, HTTPS sites using something like ngrok, localtunnel, expose, etc.
- Each MUST have a distinct domain to ensure we hit cross-site checks, so you may need to use 2 different tools
Course setup
- Login to the tool site as the admin
- Create a course called 'tool course'
- Create an assignment in the course
- From the course nav, select "More > Published as LTI tools"
- Click to publish a new resource
- Select the assignment in the "Tool to be published" field, leaving everything else alone
- Save
- In another tab, login to the platform site as the admin
- Create a course called 'platform course'
LTI 1.3 setup
- Login to the tool site as the admin user
- Go to Admin > Plugins > Enrolment plugins > Publish as LTI tool > Tool registration
- Click to create a new registration
- Name the registration "platform site" and continue
- You'll see a dynamic registration URL. Click the "Copy to clipboard" icon to copy it
- Now, in another browser tab, login as the admin user to the platform site
- Go to Site admin > Development > Debugging and set debug messages to "None". If we don't do this, we'll hit MDL-80674.
- Go to to Admin > Plugins > Activities > External tool > Manage tools
- Paste the URL value into the "Tool URL" field
- Click "Add LTI Advantage"
- You should see a tool card now. Click "Activate" on it.
- Edit the tool (click the cog)
- Set:
- "Name" to "Moodle Tool Site"
- "Tool configuration usage" to "Show in activity chooser and as a preconfigured tool"
- Save the form
Test creating a link and launching it several ways
- Login to the platform site
- Go to the course
- Click to create an activity or resource
- Select the "Moodle Tool Site" activity tile
- When you're taken to the edit form, click the "Select content" button
- In the popup, verify:
- You see a view containing the "Use existing account" card
- Since you're not logged in, you see a "Log in" button at the bottom
- Click the login button
- Proceed to login to the site
- Verify you're taken back to the previous view, but can now see "Link this account" presented as a button at the bottom. Don't login yet.
- Close the modal
- Click "Select content" again
- Verify you see the same view with "Link this account" listed. I.e. you're authenticated with the tool site inside the frame.
- Click the button to link the account, and proceed through any success notifications
- Verify you see a list of activities without errors
- Click the "Add to course" checkbox for the assignment and click "Add content"
- Verify the modal closes and you see the edit form, now updated with the assignment name
- Click "Save and return to course"
- Click the assignment you just created to launch the tool
- Verify you're taken to the assignment, inside a frame, and there are no errors on the page.
- Inside the iframe, from the top right user menu, click "Log out"
- Now, reload the page
- Verify you see the tool load within the iframe again, and that you are again logged in.
- Now, go to the site admin in the platform site
- Edit the "Moodle Tool Site" tool
- Set "Default launch container" to "New window"
- Go back to the course
- Click the assignment to launch it
- Verify you're taken to a new tab and are signed into the tool site and can view the assignment
- Log out of the tool site in this new window
- Back in the platform tab, click the assignment again in the course
- Verify you're taken to a new tab and are signed into the tool site and can view the assignment
- Now, unlink the LTI account by running this in the tool site DB:
DELETE FROM mdl_auth_lti_linked_login;
|
Repeat the above testing process - "Test creating a link and launching it several ways" - for each of:
-
- Chrome - with the --test-third-party-cookie-phaseout flag (you can set this by going to chrome://flags in the URL, then looking for 'cookies' - it'll be an option in the results there - or you can run from the command line).
- Chrome - current vanilla settings, i.e. without the flag
- Firefox - vanilla settings
Update the testing matrix (at the bottom of the testing instructions) as you proceed through each branch/browser combination.
Testing Safari
- Login to the platform site
- Go to the course
- Click to create an activity or resource
- Select the "Moodle Tool Site" activity tile
- When you're taken to the edit form, click the "Select content" button
- Verify that you see a message stating that cookies being required but were found to be blocked
- Close the modal
Testing same-site LTI
This part of the testing only needs one of the sites. Some institutions use both the LTI tool + platform plugins on the same site as a means to reuse content. Activities from one course can be used in another, via LTI. We'll set this up in the tool site.
- Log into the tool as a site admin
- Go to Site admin > Development > Debugging, and change debug messages to "None", otherwise we'll run into the following bug: MDL-80674.
- Now, go to Plugins > Enrolments > Publish as LTI tool > Tool registration
- Click "Register a platform"
- Enter "Samesite tool" as the name and continue
- Copy the dynamic registration URL
- Now go to Plugins > Activity modules > External tool > Manage tools
- Paste the URL into the "Tool URL" text box and press "Add LTI Advantage"
- Proceed with registration
- When you're redirected back to the tool listing, edit the pending tool you just registered, setting:
- Name: "Samesite tool"
- Tool configuration usage: "show in activity chooser and as a preconfigured tool"
- Save the form
- Now, on the tool list, click "Activate" on the tool card.
- Now, create a new course "Samesite testing"
- Enrol a student s1 in the course
- Click to add an activity or resource, selecting "Samesite tool" from the chooser
- On the edit form, click "Select content"
- Verify you see the welcome screen and that the "Use existing account" card contains details of your existing account
- Click "Link this account" and proceed through the confirmation notice
- Verify you see a list of activities
- Select the assignment you published (click the "Add to course" checkbox)
- Click "Add content"
- Verify the modal closes and you can see the activity name has been updated
- Save and return to course
- Launch the activity you just created
- Verify you can see the assignment loaded in an iframe
- Log out
- Log in as the student s1 and go to the "Samesite testing" course
- Launch the activity
- Verify you can see the assignment loaded in an iframe
Testing matrix
Branch |
Chrome |
Chrome w flag |
Firefox |
Safari |
4.1 |
Passed |
Passed |
Passed |
Passed |
4.2 |
Passed |
Passed |
Passed |
Passed |
4.3 |
Passed |
Passed |
Passed |
Passed |
main |
Passed |
Passed |
Passed |
Passed |
Show
Prerequisites
1. This needs to be tested in the following browsers:
Chrome - with the --test-third-party-cookie-phaseout flag (you can set this by going to chrome://flags in the URL, then looking for 'cookies' - it'll be an option in the results there).
Chrome - current vanilla settings, i.e. without the flag
Firefox - vanilla settings
Safari - vanilla settings
Please make sure you have access to these.
2. This needs to be tested using 2 public HTTPS sites on different domains. So, please make sure you can publish your dev sites using something like ngrok, localtunnel, expose, etc. etc.
3. You need two Moodle sites - one called 'platform' and one called 'tool':
In the tool site admin settings:
Enable enrol_lti and auth_lti plugins
Enable "Allow frame embedding"
Make both sites public, HTTPS sites using something like ngrok, localtunnel, expose, etc.
Each MUST have a distinct domain to ensure we hit cross-site checks, so you may need to use 2 different tools
Course setup
Login to the tool site as the admin
Create a course called 'tool course'
Create an assignment in the course
From the course nav, select "More > Published as LTI tools"
Click to publish a new resource
Select the assignment in the "Tool to be published" field, leaving everything else alone
Save
In another tab, login to the platform site as the admin
Create a course called 'platform course'
LTI 1.3 setup
Login to the tool site as the admin user
Go to Admin > Plugins > Enrolment plugins > Publish as LTI tool > Tool registration
Click to create a new registration
Name the registration "platform site" and continue
You'll see a dynamic registration URL. Click the "Copy to clipboard" icon to copy it
Now, in another browser tab, login as the admin user to the platform site
Go to Site admin > Development > Debugging and set debug messages to "None". If we don't do this, we'll hit MDL-80674 .
Go to to Admin > Plugins > Activities > External tool > Manage tools
Paste the URL value into the "Tool URL" field
Click "Add LTI Advantage"
You should see a tool card now. Click "Activate" on it.
Edit the tool (click the cog)
Set:
"Name" to "Moodle Tool Site"
"Tool configuration usage" to "Show in activity chooser and as a preconfigured tool"
Save the form
Test creating a link and launching it several ways
Login to the platform site
Go to the course
Click to create an activity or resource
Select the "Moodle Tool Site" activity tile
When you're taken to the edit form, click the "Select content" button
In the popup, verify :
You see a view containing the "Use existing account" card
Since you're not logged in, you see a "Log in" button at the bottom
Click the login button
Proceed to login to the site
Verify you're taken back to the previous view, but can now see "Link this account" presented as a button at the bottom. Don't login yet.
Close the modal
Click "Select content" again
Verify you see the same view with "Link this account" listed. I.e. you're authenticated with the tool site inside the frame.
Click the button to link the account, and proceed through any success notifications
Verify you see a list of activities without errors
Click the "Add to course" checkbox for the assignment and click "Add content"
Verify the modal closes and you see the edit form, now updated with the assignment name
Click "Save and return to course"
Click the assignment you just created to launch the tool
Verify you're taken to the assignment, inside a frame, and there are no errors on the page.
Inside the iframe, from the top right user menu, click "Log out"
Now, reload the page
Verify you see the tool load within the iframe again, and that you are again logged in.
Now, go to the site admin in the platform site
Edit the "Moodle Tool Site" tool
Set "Default launch container" to "New window"
Go back to the course
Click the assignment to launch it
Verify you're taken to a new tab and are signed into the tool site and can view the assignment
Log out of the tool site in this new window
Back in the platform tab, click the assignment again in the course
Verify you're taken to a new tab and are signed into the tool site and can view the assignment
Now, unlink the LTI account by running this in the tool site DB:
DELETE FROM mdl_auth_lti_linked_login;
Repeat the above testing process - "Test creating a link and launching it several ways" - for each of:
Chrome - with the --test-third-party-cookie-phaseout flag (you can set this by going to chrome://flags in the URL, then looking for 'cookies' - it'll be an option in the results there - or you can run from the command line).
Chrome - current vanilla settings, i.e. without the flag
Firefox - vanilla settings
Update the testing matrix (at the bottom of the testing instructions) as you proceed through each branch/browser combination.
Testing Safari
Login to the platform site
Go to the course
Click to create an activity or resource
Select the "Moodle Tool Site" activity tile
When you're taken to the edit form, click the "Select content" button
Verify that you see a message stating that cookies being required but were found to be blocked
Close the modal
Testing same-site LTI
This part of the testing only needs one of the sites. Some institutions use both the LTI tool + platform plugins on the same site as a means to reuse content. Activities from one course can be used in another, via LTI. We'll set this up in the tool site.
Log into the tool as a site admin
Go to Site admin > Development > Debugging, and change debug messages to "None", otherwise we'll run into the following bug: MDL-80674 .
Now, go to Plugins > Enrolments > Publish as LTI tool > Tool registration
Click "Register a platform"
Enter "Samesite tool" as the name and continue
Copy the dynamic registration URL
Now go to Plugins > Activity modules > External tool > Manage tools
Paste the URL into the "Tool URL" text box and press "Add LTI Advantage"
Proceed with registration
When you're redirected back to the tool listing, edit the pending tool you just registered, setting:
Name: "Samesite tool"
Tool configuration usage: "show in activity chooser and as a preconfigured tool"
Save the form
Now, on the tool list, click "Activate" on the tool card.
Now, create a new course "Samesite testing"
Enrol a student s1 in the course
Click to add an activity or resource, selecting "Samesite tool" from the chooser
On the edit form, click "Select content"
Verify you see the welcome screen and that the "Use existing account" card contains details of your existing account
Click "Link this account" and proceed through the confirmation notice
Verify you see a list of activities
Select the assignment you published (click the "Add to course" checkbox)
Click "Add content"
Verify the modal closes and you can see the activity name has been updated
Save and return to course
Launch the activity you just created
Verify you can see the assignment loaded in an iframe
Log out
Log in as the student s1 and go to the "Samesite testing" course
Launch the activity
Verify you can see the assignment loaded in an iframe
Testing matrix
Branch
Chrome
Chrome w flag
Firefox
Safari
4.1
Passed
Passed
Passed
Passed
4.2
Passed
Passed
Passed
Passed
4.3
Passed
Passed
Passed
Passed
main
Passed
Passed
Passed
Passed