WeBWorK Main Forum

How to see LTI 1.3 debug info?

How to see LTI 1.3 debug info?

by Szabolcs Horvát -
Number of replies: 5

When I access WeBWorK though Canvas, I see the following error: "The LTI Advantage login route was accessed with invalid or missing parameters."

How can I see the full debug output?

In authen_LTI.conf, I have $debug_lti_parameters = 1; (and also $debug_lti_grade_passback = 1;). I am looking in webwork2/logs/webwork2.log, and the only long line that appears at the precise time of failure is:

"[/webwork2/ltiadvantage/login] The LTI Advantage login route was accessed with invalid or missing parameters."

The actual parameters are not displayed.

The same error was mentioned in https://webwork.maa.org/moodle/mod/forum/discuss.php?d=8513 Glenn Rice kindly responded there, saying that either $LTI{v1p3}{PlatformID} or $LTI{v1p3}{ClientID} must be incorrect. Unfortunately, I have no direct way to verify the ClientID as I do not have Canvas administrator access at our site, and need to rely on information I receive indirectly.

Is there  a way I can check what Canvas is _actually_ sending?


In reply to Szabolcs Horvát

Re: How to see LTI 1.3 debug info?

by Szabolcs Horvát -
I managed to see the information passed by Canvas by temporarily modifying (then reverting) the WeBWorK source code to print this info. The problem was that the PlatformID was not "https://ourschool.instructure.com" (where we access Canvas), but literally "https://canvas.instructure.com". It is in fact mentioned in the documentation that it may be either of the two, but somehow it didn't click in my brain. https://webwork.maa.org/wiki/LTI_Authentication_(for_WeBWorK_2.18_or_newer)#Canvas_LTI_1.3_Configuration

I'm still interested the correct way to display debug info with LTI 1.3.
In reply to Szabolcs Horvát

Re: How to see LTI 1.3 debug info?

by Szabolcs Horvát -
It looks like once the PlatformID was fixed, I do see some relevant debug output in webwork2.log. Before PlatformID was fixed, no debug output was displayed at all.
In reply to Szabolcs Horvát

Re: How to see LTI 1.3 debug info?

by Glenn Rice -

As noted in the conf/authen_LTI.conf file, you can also enable the general debug facility in the conf/webwork2.mojolicious.yml file.  That gives extensive debugging information.  Then you can see which parameters are received and what their values are.  For setting up LTI 1.3 this is usually better than just setting $debug_lti_parameters due to the way that LTI 1.3 authentication works.

In reply to Glenn Rice

Re: How to see LTI 1.3 debug info?

by Szabolcs Horvát -
Thank you, this does indeed work.

A related question: How can I determine how to set the source of the student ID, so I wouldn't have to rely on user IDs?

When I access webwork2 through Canvas using my own user, and look in webwork2.log, I see the following:

  "https://purl.imsglobal.org/spec/lti/claim/lis" => {
    "course_offering_sourcedid" => "CCCC",
    "errors" => {
      "errors" => {}
    },
    "person_sourcedid" => "SSSS",
    "validation_context" => undef
  },

Here CCCC is the course ID, and SSSS is my student ID from Canvas. This is the only place my Canvas student ID appears in the logs. Based on this, I set

$LTI{v1p3}{preferred_source_of_student_id} = 'person_sourcedid';

However, I still see an empty student ID being determined:

Student id is ||
preferred_source_of_student_id is |person_sourcedid|

How can I specify the source of the student ID with LTI 1.3 in a way that it would actually be picked up? How can I find out what is the correct name of the source?

In reply to Szabolcs Horvát

Re: How to see LTI 1.3 debug info?

by Glenn Rice -

Use

$LTI{v1p3}{preferred_source_of_username} = 'https://purl.imsglobal.org/spec/lti/claim/lis#person_sourcedid';

This is documented in conf/authen_LTI_1_3.conf.