Search code examples
desire2learn

Accessing data passed to External Learning Tool from D2L


When setting up a link to an External Learning Tool, there are checkboxes labelled as 'Security Settings' which allow information (context information, for example) to be passed to the external tool.

How can this information be accessed from the tool?


Solution

  • Per the LTI spec parameters are passed as form post variables.

    For example, php code to access the contact email address would be:

    //Grab some LTI related parameters 
    if (isset($_REQUEST['lis_person_contact_email_primary']))
    {
        $email = $_REQUEST['lis_person_contact_email_primary'];
    }
    

    In D2L you can also combine LTI launches with Valence API calls as explained in the LTI and Valence article.

    (You should also be validating the LTI oauth signature in order to be confident in your tool the request comes from the D2L Instance that has the key and secret for your tool)