Mahara portfolio as Moodle assignment cannot be previewed

Bug #1859605 reported by Peter Spicer
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Medium
Unassigned
18.10
Fix Released
Medium
Unassigned
19.04
Fix Released
Medium
Unassigned
19.10
Fix Released
Medium
Unassigned

Bug Description

When using the assignsubmission_mahara plugin to connect Moodle assignments to Mahara, the link to view the portfolio works fine to open Mahara, but the preview iframe in Moodle doesn't.

This is because MNET auth doesn't set up the session in the same way as LTI does with the CSP being set to allow such things. Fixing this is mostly a matter of copying the setup code into the MNET landing page:

    $parts = parse_url($remotewwwroot);
    $cspurl = $parts['scheme'] . '://' . $parts['host'];
    $SESSION->set('csp-ancestor-exemption', $cspurl);

I am mindful that LTI is considered the future direction of Mahara, but we have customers who use MNET and can't move to LTI because it does not meet their needs at this time, and this improves the workflow a tiny bit for them without a significant overhaul of anything.

Happy to submit as a formal patch for all currently supported versions of Mahara if that would help.

Tags: mnet
Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/10713

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Patch for "19.10_STABLE" branch: https://reviews.mahara.org/10714

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Patch for "19.04_STABLE" branch: https://reviews.mahara.org/10715

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Patch for "18.10_STABLE" branch: https://reviews.mahara.org/10716

Revision history for this message
Peter Spicer (peter.spicer) wrote :

On reflection, I've just pushed the changes for review as-is for 18.10, 19.04, 19.10 and master.

Changed in mahara:
status: New → In Progress
Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/10713
Committed: https://git.mahara.org/mahara/mahara/commit/b160d285e29265846e03d3b97ee9e208ddf32cb6
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit b160d285e29265846e03d3b97ee9e208ddf32cb6
Author: Peter Spicer <email address hidden>
Date: Mon Jan 13 17:40:13 2020 +0000

Bug 1859605 Allow MNET remote peer to be included in CSP

When using Mahara preview from Moodle grading interface, this initiates
an MNET jump inside an iframe, which fails due to the remotewwwhost not
being specified inside the Content-Security-Policy. Mahara does make
this configurable, but not from inside the MNET workflow by default.

Change-Id: I26cd51f98e7b1880367eedadfaad41aad3a88138
behatnotneeded: Requires MNET to be configured

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/10714
Committed: https://git.mahara.org/mahara/mahara/commit/c6b5cc7df618266e60b91a9931cd7b71303fe1aa
Submitter: Robert Lyon (<email address hidden>)
Branch: 19.10_STABLE

commit c6b5cc7df618266e60b91a9931cd7b71303fe1aa
Author: Peter Spicer <email address hidden>
Date: Mon Jan 13 17:40:13 2020 +0000

Bug 1859605 Allow MNET remote peer to be included in CSP

When using Mahara preview from Moodle grading interface, this initiates
an MNET jump inside an iframe, which fails due to the remotewwwhost not
being specified inside the Content-Security-Policy. Mahara does make
this configurable, but not from inside the MNET workflow by default.

Change-Id: I26cd51f98e7b1880367eedadfaad41aad3a88138
behatnotneeded: Requires MNET to be configured

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/10715
Committed: https://git.mahara.org/mahara/mahara/commit/3a306423f2e96c7c086d51a01abeb476ab740f80
Submitter: Robert Lyon (<email address hidden>)
Branch: 19.04_STABLE

commit 3a306423f2e96c7c086d51a01abeb476ab740f80
Author: Peter Spicer <email address hidden>
Date: Mon Jan 13 17:40:13 2020 +0000

Bug 1859605 Allow MNET remote peer to be included in CSP

When using Mahara preview from Moodle grading interface, this initiates
an MNET jump inside an iframe, which fails due to the remotewwwhost not
being specified inside the Content-Security-Policy. Mahara does make
this configurable, but not from inside the MNET workflow by default.

Change-Id: I26cd51f98e7b1880367eedadfaad41aad3a88138
behatnotneeded: Requires MNET to be configured

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/10716
Committed: https://git.mahara.org/mahara/mahara/commit/d8a71826e12a640502751105dffe72693d46436c
Submitter: Robert Lyon (<email address hidden>)
Branch: 18.10_STABLE

commit d8a71826e12a640502751105dffe72693d46436c
Author: Peter Spicer <email address hidden>
Date: Mon Jan 13 17:40:13 2020 +0000

Bug 1859605 Allow MNET remote peer to be included in CSP

When using Mahara preview from Moodle grading interface, this initiates
an MNET jump inside an iframe, which fails due to the remotewwwhost not
being specified inside the Content-Security-Policy. Mahara does make
this configurable, but not from inside the MNET workflow by default.

Change-Id: I26cd51f98e7b1880367eedadfaad41aad3a88138
behatnotneeded: Requires MNET to be configured

no longer affects: mahara/20.04
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers