Moodle (3.9.3+), LTI 1.3 and custom parameters

384 views
Skip to first unread message

Tom Reijnders

unread,
Jan 3, 2021, 2:20:52 AM1/3/21
to Tsugi Developers
Hi,

I successfully setup a LTI 1.3 issuer and key between Moodle 3.9.3+ and the latest tsugi. The launch is successfull as far as I can tell. However, I am not able to get the value of some custom parameter that I set on the tool laucnch in Moodle.

I use $LAUNCH->ltiCustomGet('variable'), and that returns false.

The array returned by $LAUNCH->ltiParametersArray() seems to look ok, but there is no mention whatsoever of any custom parameters. Do any of you  know whether this is a Moodle issue or a Tsugi issue? Or that I should get the custom paremeters in a different way, if using LTI 1.3?

Cheers,

Tom

Tom Reijnders

unread,
Jan 3, 2021, 7:53:18 AM1/3/21
to Tsugi Developers
The custom paaremeters seem to be sent from Moodle to Tsugi. If I decode the JWT in the launch post array, than I see this as part of the decode JSON:

https:\/\/purl.imsglobal.org\/spec\/lti\/claim\/custom: {
  template_id: "718",
  test: "123",
  custom: "parameter",
  system_setting_url: "https:\/\/moodle.xxxxx.xxx\/mod\/lti\/services.php\/tool\/7\/custom",
  context_setting_url: "https:\/\/moodle.xxxxx.xxx\/mod\/lti\/services.php\/CourseSection\/7\/bindings\/tool\/7\/custom",
  link_setting_url: "https:\/\/moodle.xxxxx.xxx\/mod\/lti\/services.php\/links\/{link_id}\/custom"
 },

So what is the best way to retrieve those? The $LAUNCH->ltiParameterArry is as follows:


‌array (
  'issuer_id' => '1',
  'issuer_client' => '84ec9vliXSpoOW1',
  'lti13_kid' => '9d30a46f523acc59d404',
  'lti13_keyset_url' => 'https://moodle.xxxxx.xxx/mod/lti/certs.php',
  'lti13_keyset' => '{
    "keys": [
        {
            "kty": "RSA",
            "alg": "RS256",
            "kid": "9d30a46f523acc59d404",
            "e": "AQAB",
            "n": "*** REMOVED ***",
            "use": "sig"
        }
    ]
}',
  'lti13_platform_pubkey' =>  *** REMOVED ***,
  'lti13_privkey' =>   **** REMOVED ****,
  'lti13_token_audience' => '',
  'deploy_key' => '7',
  'subject_key' => '5',
  'key_id' => '73',
  'key_key' => NULL,
  'secret' => 'AES::kgEZ4iO78V8=',
  'new_secret' => NULL,
  'key_settings_url' => NULL,
  'key_login_at' => '2021-01-03 13:31:36',
  'nonce' => NULL,
  'context_id' => '99',
  'context_title' => 'Test LTI module 01012021',
  'context_sha256' => '7902699be42c8a8e46fbbb4501726517e86b22c56a189f7625a6da49081b2451',
  'context_settings_url' => NULL,
  'ext_memberships_id' => NULL,
  'ext_memberships_url' => NULL,
  'lineitems_url' => NULL,
  'memberships_url' => NULL,
  'lti13_membership_url' => 'https://moodle. xxxxx.xxx  /mod/lti/services.php/CourseSection/7/bindings/7/memberships',
  'link_id' => '107',
  'link_path' => 'https://dev. xxxxx.xxx/xotdev/lti_launch.php',
  'link_title' => 'Simple LTI test (1.3)',
  'link_settings' => NULL,
  'link_settings_url' => NULL,
  'lti13_lineitem' => 'https://moodle. xxxxx.xxx/mod/lti/services.php/7/lineitems/18/lineitem?type_id=7',
  'user_id' => '30',
  'user_displayname' => 'Tom Reijnders',
  'user_email' => 'xx...@xxxxx.xxx',
  'user_key' => NULL,
  'user_image' => NULL,
  'user_locale' => NULL,
  'subscribe' => NULL,
  'user_sha256' => NULL,
  'membership_id' => '32',
  'role' => '0',
  'role_override' => NULL,
  'result_id' => '34',
  'grade' => NULL,
  'result_url' => NULL,
  'sourcedid' => NULL,
  'profile_id' => NULL,
  'profile_displayname' => NULL,
  'profile_email' => NULL,
  'profile_subscribe' => NULL,
  'service' => NULL,
  'service_id' => NULL,
)

Cheers,

Tom


Reply all
Reply to author
Forward
0 new messages