Skip to content

Deploy: Configuration for LTI 1.3 Deployment

Mr. Lance E Sloan «UMich» edited this page Dec 18, 2023 · 18 revisions

Install and Configure MyLA

To complete the steps in the following sections, MyLA must be configured according to the project's README.md document. It needs to be installed on a server that the LMS can contact it via HTTPS.

Generate Keys

To enable LTI launch requests, MyLA needs a public and private RS256 key pair in PEM format.

MyLA includes a key generation program, createkeys, that can be run via the Django management tool, manage.py. While MyLA is running in a Docker container, enter the following command to create key files:

docker exec -it student_dashboard python manage.py createkeys

The program will create the new key files in the same directory that holds the env.hjson configuration file.

It will create two files with the suffixes _private.pem and _public.pem. By default, the two files will be named with a timestamp of the format YYYYmmddHHMMSS, followed by one of the suffixes. If you want to specify a different name for the key files, use the --basename option:

docker exec -it student_dashboard python manage.py createkeys --basename example

That will create key files named example_private.pem and example_public.pem. These are the names that will be used in the examples that follow.

Configure Security Settings

  • The CSP block of the settings can be copied and should work as is.
  • Change "REPORT_ONLY" to false if there are no console errors in your browser when testing
  • You'll also need "CSRF_COOKIE_SECURE": true when running on HTTPS.

Configure LTI Settings

⚠️ – The hostname myla.example.edu appears several times in the following configuration examples. It must be replaced with the hostname of the computer on which MyLA has been installed.

  • There are a number of LTI settings including
    • "STUDENT_DASHBOARD_LTI" : true
      This setting enables LTI support.
  • Go to your Canvas Admin for your instance → Developer Keys and select +LTI key
  • In the "Method" menu, select "Enter URL".
  • In the "JSON URL" field that appears, enter the configuration URL from your MyLA server, like https://myla.example.edu/lti/config/.
  • In the "Key Name" field, enter a meaningful name for the new LTI key, like "MyLA".
  • In the "Owner Email" field, enter your email address or some other email address that should be used by Canvas administrators to contact someone about the new LTI key.
  • In the "Redirect URIs" field, enter the launch URL for your MyLA server, like https://myla.example.edu/lti/launch/.
  • Click the "Save" button.

At this point, the key has been created with the name given in the "Key Name" field. However, some settings will have default or autogenerated values and should be changed to meaningful values before using it.

  • Find the new key by name and click the ✎ (pencil) icon to edit it.

  • Select the "Manual Entry" method if it's not selected already.

  • Change the values in fields "Title" and "Description". By default, they contain "MyLA autoconfig-[timestamp here]" and "MyLA automatically generated configuration", respectively.

  • Browse through the other settings and verify that they are set correctly.

  • When all settings are as needed, click the "Save" button to save the changes.

  • Change "State" from OFF to ON for the newly created key

  • Install the LTI APP to your course, subaccount, or root account as desired. The key's default: disabled option prevents the tool from appearing in course navigation until it is explicitly requested.

  • Create new External App: "Settings → Apps → View App Configurations → +App"

  • Choose "Configuration Type: by ClientID"

  • Insert "ClientID" from the created Key (value from Details column)

  • Update client_id setting in LTI_CONFIG section of env.hjson

    "/*  LTI 1.3 configuration": "*/",
    "/*  The first key of LTI_CONFIG is the Canvas URL (production, beta, or test)": "*/",
    "LTI_CONFIG": {
      "https://canvas.instructure.com": [
        {
          "/* requests without ID from this platform use this config by default": "*/",
          "default": true,
          "/* from Canvas: Developer Keys → value from Details column": "*/",
          "client_id": "10000000000004",
          "/*Allowed hosts for the following 3 URLs: canvas.instructure.com, canvas.beta.instructure.com, canvas.test.instructure.com": "*/",
          "auth_login_url": "http://canvas.instructure.com/api/lti/authorize_redirect",
          "auth_token_url": "http://canvas.instructure.com/login/oauth2/token",
          "key_set_url": "http://canvas.instructure.com/api/lti/security/jwks",
          "/* this tool's private key ": "*/",
          "private_key_file": "/secrets/example_private.pem",
          "/* this tool's public key ": "*/",
          "public_key_file": "/secrets/example_public.pem",
          "/* Go to Canvas where this tool installed, click on the setting button (a gear icon, similar to '⚙️'), click 'Deployment Id', copy it, and paste here": "*/",
          "deployment_ids": [
            "9:0123456789abcdef0123456789abcdef01234567"
          ]
        }
      ]
    },
  • Enable the LTI in the Course navigation, depending on where you have installed the LTI tool (course, subaccount, or root account).

    • Go to the course where MyLA was installed
    • Settings → Navigation
    • Enable MyLA and save
    • MyLA will appear in left navigation
    • Click on MyLA in the navigation to add the course to the MyLA database

After the configuration changes are complete, the MyLA application must be restarted in order for them to take effect.