celtic-project/webpa-lti

Plugin Doesn't Use https://purl.imsglobal.org/spec/lti/claim/launch_presentation Claim

Opened this issue · 3 comments

Hi Stephen,

I think the behaviour of the plugin, when opened in an iframe, is different on LTI 1.3 to earlier versions. The menu doesn't change to be "Return to VLE" instead of Log Out in LTI 1.3 because we aren't reading the https://purl.imsglobal.org/spec/lti/claim/launch_presentation claim.

I've tested this in Learn and Learn does set this claim but doesn't set the target_document value unless it opens the tool in a new window (at which point, the value is set to 'window')

I think this is potentially tricky to handle as we can't assume that the absence of this value means it must have a target of frame or iframe in other VLEs so a global solution might be hard to achieve unless we have specific handling behaviour for different VLEs.

Wanted to get your thoughts on this? I'm happy to provide a PR for Blackboard Learn but don't have the ability to test for Moodle/Canvas/D2L etc.

You are correct. The code is not checking for this parameter in the correct place so it is being ignored for LTI 1.3 connections. Instead of using lti_fetch_POST it should be checking $this->messageParameters. I'll fix this.

In my experience, however, not all VLEs are properly setting this parameter - some send the same value regardless of where the tool is being opened (mentioning no names!).

Hi Stephen. The fix applied doesn't work for Blackboard Learn unfortunately. I modified the tool.php file to the following:

if (!empty($this->jwt->getClaim('https://purl.imsglobal.org/spec/lti/claim/launch_presentation'))) {
                $this->returnUrl = $this->messageParameters['launch_presentation_return_url'];

                if (strtolower($this->messageParameters['launch_presentation_document_target']) !== 'window') {
                    $_SESSION['logout_url'] = $this->returnUrl;
                    $_SESSION['_no_header'] = true;
                }
            }

This seems to work. I think the issue is that if we open WebPA in a frame, Blackboard omits the document_target field but does set a return url. It only sets the document_target field when WebPA is opened in a new window

Support for this parameter appears to be rather poor with some of the major VLEs. One sends the same value wherever the tool is opened, and says that a fix would require "a significant amount of work to implement" and so has chosen not to! When an invalid value is passed or a value is not always passed (as in the case of Anthology Learn) it is difficult for a tool to make much use of it.

In the case of WebPA it is trying to use it to determine whether a "log out" link or a "return to VLE" is shown. It assumes the former when no value is provided. The only solutions I can think of are:

  1. Remove this code and always show the "return to VLE" option (or always the "log out" option).
  2. Allow a platform to pass a default value for this parameter to be used when none is provided in the message (or possibly to be always used).
  3. When using LTI 1.3, use Javascript to check whether the tool is being opened in its own window and use this instead of relying on any parameter value being passed.

Any of these (or something different) sound useful?