LTI (Canvas) gives exception: WebserviceInvalidParameterException

Bug #1697909 reported by Simon Booth
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
High
Cecilia Vela Gurovic
17.04
Fix Released
High
Cecilia Vela Gurovic
17.10
Fix Released
High
Cecilia Vela Gurovic

Bug Description

Having set up LTI in Mahara and provided Canvas with the Key/Secret and Launch URL:

http://mahara-dev.stir.ac.uk/webservice/rest/server.php

and custom parameter:

wsfunction=module_lti_launch

Clicking on the Mahara link gets:

<EXCEPTION class="WebserviceInvalidParameterException"><ERRORCODE>invalidparameter</ERRORCODE><MESSAGE>Invalid parameter value detected; execution cannot continue. : Unexpected keys (custom_canvas_course_uuid,custom_canvas_user_uuid,lis_course_offering_sourcedid,) detected in parameter array.</MESSAGE></EXCEPTION>

similiar comes from Blackboard

Revision history for this message
Kristina Hoeppner (kris-hoeppner) wrote :

Canvas added new parameters. The quick fix: Add them to the Mahara file module_lti_launch.php and you'll be fine. We are investigating a long-term solution that is secure.

Changed in mahara:
status: New → Confirmed
importance: Undecided → High
Revision history for this message
Kristina Hoeppner (kris-hoeppner) wrote :

The idea to circumvent this problem of LMSs passing through custom variables that we don't need is to strip out the checking for custom parameters (as they are not part of the standard).

When the site is in developermode / productionmode = false, an error would be thrown so that the site admin is aware of custom parameters being passed through.

Revision history for this message
Worth Bishop (wbishop) wrote :

Not to hijack this thread, but we encountered the error message above in a Mahara/Canvas implementation, along with a similar-but-different parameter issue. Mentioning it here in case others encounter also.

After adding the Canvas-specific parameters to the module_lti_launch.php file, we found Admin could connect, but a regular user received an error as above except citing the missing parameter, "lis_course_offering_sourcedid".

This parameter was missing from the module_lti_launch.php file as well.

We note that lis_course_offering_sourcedid is described in Section 6 of the Basic LTI Implementation Guide, Version 1, May 17, 2010 - Final (see: https://www.imsglobal.org/specs/ltiv1p0/implementation-guide).

Have added that parameter to the file as well as:

'lis_course_offering_sourcedid' => new external_value(PARAM_TEXT, 'LTI lis_course_offering_sourcedid', VALUE_OPTIONAL),

which seems to have cured the problem.

Looking forward to the "long term solution" alluded to above!

Revision history for this message
Kristina Hoeppner (kris-hoeppner) wrote :

Thanks for reporting your parameter. The solution we have in mind should catch them all.

Revision history for this message
Kristina Hoeppner (kris-hoeppner) wrote :

Implementation idea in succinct fashion:

If an LTI parameter is unknown and prefixed with 'custom_', drop it from the data passed to the handler function. Then if the site is in non-production mode, throw an error rather than dropping the data.

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/7872

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

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

commit e120d8fd2a6c20b8ae510d1e16deb113dbd6f85d
Author: Cecilia Vela Gurovic <email address hidden>
Date: Wed Jul 12 16:13:53 2017 +1200

Bug 1697909: 'custom_' unknown param not an exception in WS

If an LTI parameter is unknown and prefixed with 'custom_',
drop it from the data passed to the handler function.
Then if the site is in non-production mode,
also show this information.

behatnotneeded

Change-Id: I3fac19c27df2b9f072b8cdbcb8a2458c506c018e

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

Patch for "17.04_STABLE" branch: https://reviews.mahara.org/7895

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/7895
Committed: https://git.mahara.org/mahara/mahara/commit/b6c70e6a415a5d990eea69cf11cee7bf27d27c53
Submitter: Robert Lyon (<email address hidden>)
Branch: 17.04_STABLE

commit b6c70e6a415a5d990eea69cf11cee7bf27d27c53
Author: Cecilia Vela Gurovic <email address hidden>
Date: Wed Jul 12 16:13:53 2017 +1200

Bug 1697909: 'custom_' unknown param not an exception in WS

If an LTI parameter is unknown and prefixed with 'custom_',
drop it from the data passed to the handler function.
Then if the site is in non-production mode,
also show this information.

behatnotneeded

Change-Id: I3fac19c27df2b9f072b8cdbcb8a2458c506c018e
(cherry picked from commit e120d8fd2a6c20b8ae510d1e16deb113dbd6f85d)

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/9818

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

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

commit 515cfba646dee807fda37faeb89f8e71d132b379
Author: Robert Lyon <email address hidden>
Date: Tue Apr 23 11:06:58 2019 +1200

Bug 1825894: Ignore extra parameters in webservices

We had a patch for ignoring parameters prefixed with 'custom_' in
bug 1697909 - but there were still problems from users when trying to
install LTI connections.

So we will now ignore any unknown parameter and let the user know by
recording this in the Mahara error log - we however will not be
returning the info about the extra parameters back to the system that
made the webservice call

behatnotneeded

Change-Id: I0cf5d966833a48e7db13d48b9e0be87285934002
Signed-off-by: Robert Lyon <email address hidden>

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

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

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

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

commit e39ac7ce2f9824a67ac91e38fa76b80b4b392423
Author: Robert Lyon <email address hidden>
Date: Tue Apr 23 11:06:58 2019 +1200

Bug 1825894: Ignore extra parameters in webservices

We had a patch for ignoring parameters prefixed with 'custom_' in
bug 1697909 - but there were still problems from users when trying to
install LTI connections.

So we will now ignore any unknown parameter and let the user know by
recording this in the Mahara error log - we however will not be
returning the info about the extra parameters back to the system that
made the webservice call

behatnotneeded

Change-Id: I0cf5d966833a48e7db13d48b9e0be87285934002
Signed-off-by: Robert Lyon <email address hidden>
(cherry picked from commit 515cfba646dee807fda37faeb89f8e71d132b379)

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

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

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

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

commit 3f05d3f4d7c5d76cd1b6b340fe3efc4572e8714e
Author: Robert Lyon <email address hidden>
Date: Tue Apr 23 11:06:58 2019 +1200

Bug 1825894: Ignore extra parameters in webservices

We had a patch for ignoring parameters prefixed with 'custom_' in
bug 1697909 - but there were still problems from users when trying to
install LTI connections.

So we will now ignore any unknown parameter and let the user know by
recording this in the Mahara error log - we however will not be
returning the info about the extra parameters back to the system that
made the webservice call

behatnotneeded

Change-Id: I0cf5d966833a48e7db13d48b9e0be87285934002
Signed-off-by: Robert Lyon <email address hidden>
(cherry picked from commit 515cfba646dee807fda37faeb89f8e71d132b379)
(cherry picked from commit e39ac7ce2f9824a67ac91e38fa76b80b4b392423)

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

Patch for "18.04_STABLE" branch: https://reviews.mahara.org/9823

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/9823
Committed: https://git.mahara.org/mahara/mahara/commit/6a44495b1ec01553473deb3a4b15d98625802c58
Submitter: Robert Lyon (<email address hidden>)
Branch: 18.04_STABLE

commit 6a44495b1ec01553473deb3a4b15d98625802c58
Author: Robert Lyon <email address hidden>
Date: Tue Apr 23 11:06:58 2019 +1200

Bug 1825894: Ignore extra parameters in webservices

We had a patch for ignoring parameters prefixed with 'custom_' in
bug 1697909 - but there were still problems from users when trying to
install LTI connections.

So we will now ignore any unknown parameter and let the user know by
recording this in the Mahara error log - we however will not be
returning the info about the extra parameters back to the system that
made the webservice call

behatnotneeded

Change-Id: I0cf5d966833a48e7db13d48b9e0be87285934002
Signed-off-by: Robert Lyon <email address hidden>
(cherry picked from commit 515cfba646dee807fda37faeb89f8e71d132b379)
(cherry picked from commit e39ac7ce2f9824a67ac91e38fa76b80b4b392423)
(cherry picked from commit 3f05d3f4d7c5d76cd1b6b340fe3efc4572e8714e)

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

Patch for "17.10_STABLE" branch: https://reviews.mahara.org/9824

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

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

commit 3f4e5c399f4fb0075a580a86b981dfd4f06cd500
Author: Robert Lyon <email address hidden>
Date: Tue Apr 23 11:06:58 2019 +1200

Bug 1825894: Ignore extra parameters in webservices

We had a patch for ignoring parameters prefixed with 'custom_' in
bug 1697909 - but there were still problems from users when trying to
install LTI connections.

So we will now ignore any unknown parameter and let the user know by
recording this in the Mahara error log - we however will not be
returning the info about the extra parameters back to the system that
made the webservice call

behatnotneeded

Change-Id: I0cf5d966833a48e7db13d48b9e0be87285934002
Signed-off-by: Robert Lyon <email address hidden>
(cherry picked from commit 515cfba646dee807fda37faeb89f8e71d132b379)
(cherry picked from commit e39ac7ce2f9824a67ac91e38fa76b80b4b392423)
(cherry picked from commit 3f05d3f4d7c5d76cd1b6b340fe3efc4572e8714e)
(cherry picked from commit 6a44495b1ec01553473deb3a4b15d98625802c58)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.