Configuring LTI
Avalon as an LTI tool in a Learning Management System (LMS)
Avalon can be configured to work as an LTI tool in a Learning Management System, allowing access to media based on course membership. To access course items, a user can log into their LMS, click on an external tool link, and be redirected to a special Avalon context that only shows items authorized for the course. As part of the redirect, Avalon gathers course and user information verified by OAuth. Using the course ID, Avalon customizes the landing page for the user to only show items listed for that course.
After using the LTI tool, a user will still be logged in under that context when using the same Avalon instance in the same browser. Logging out of the application then logging back in will clear the session and resolve this.
Avalon Setup: Configure LTI authentication provider and add LMS
LTI 1.1
The authentication settings for LTI can be added to config/settings.yml with the other authentication providers. Setting the "hidden" parameter allows the LTI provider from showing up at the log in screen. The oauth_credentials parameter is a set of key/secret credential pairs used to authenticate the incoming LTI tool requests. Multiple can be configured for use within a single LMS or across LMSes. An example LTI authentication config block is commented out in settings.yml:
- :name: Avalon LTI Oauth
:provider: :lti
:hidden: true
:params:
:oauth_credentials:
somekey: somesecretConfigure LTI information mapping
Avalon uses the configuration options in config/lti.yml to map values returned by the LMS in the auth hash for user, class and lms information. There are default values hard-coded into our version of the gem omniauth-lti. You'll only need to add the lti.yml if any of these values are different for your LMS.
config/lti.yml
---
<tool_consumer_instance_guid>:
:uid: :user_id
:email: :lis_person_contact_email_primary
:context_id: :context_id
:context_name: :context_labelLTI 1.3
LTI 1.3 support will be added in Avalon 8.3.
LTI 1.3 has a more robust authentication process thus more configuration for each LMS. Under the platforms parameter, multiple LMSes can be configured. Each LMS can have multiple distinct LTI tool integrations with unique ids configured here as deployment_ids. More explanation of the other settings appears in the LMS specific instructions below. An example LTI authentication config block is commented out in settings.yml:
- :name: Avalon Lti OAuth
:provider: :lti
:protocol: '1.3'
:hidden: true
:params:
:platforms:
- :issuer: https://canvas.example.edu
:client_id: someclientid
:deployment_ids: ["somedeploymentid"]
:jwks_uri: https://canvas.example.edu/api/lti/security/jwks
:authorization_endpoint: https://canvas.example.edu/api/lti/authorize
:redirect_uri: https://avalon.example.edu/users/auth/lti/callbackLMS Setup: Configure the LTI tool and create a link to Avalon
Canvas
Canvas allows for the specification of global as well as course-specific LTI providers called external apps.
LTI 1.1
Follow Canvas’ instructions for manually adding an external app and select LTI version 1.1. The consumer key and shared secret are the values you configured in config/settings.yml. The Launch URL is the base url for Avalon with /users/auth/lti/callback (e.g. http://localhost:3000/users/auth/lti/callback). Set privacy to Public so Avalon receives both username and email. After adding the external app you should be able to place it within a course based upon the configured allowed placements and test it out.
LTI 1.3
Follow Canvas’ instructions for manually adding an external app and select LTI version 1.3. For the redirect urls and default target link uri use the base url for your Avalon instance and add /users/auth/lti/callback (e.g. http://localhost:3000/users/auth/lti/callback). For the OpenID Connect Initiation URL use the same url without /callback (e.g. http://localhost:3000/users/auth/lti). Select Public JWKS URL for the JWK method and set the JWK URL to the canvas base url with /api/lti/security/jwks (e.g. http://localhost:8000/api/lti/security/jwks). You’ll need to configure the data shared to Avalon (at minimum username and email) and the allowed placements for the external app within canvas. After adding the external app you should be able to place it within a course based upon the configured allowed placements.
To finish setup within Avalon, you’ll need to find the find the client id and deployment id for the external app in the external app’s configuration in Canvas. Then edit the auth block in config/settings.yml filling in the client id, deployment id, and base urls. Restart avalon and test out your external app in Canvas.
- :name: Avalon Lti OAuth
:provider: :lti
:protocol: '1.3'
:hidden: true
:params:
:platforms:
- :issuer: https://canvas.instructure.com
:client_id: <client id>
:deployment_ids: ["<deployment id>"]
:jwks_uri: <canvas base url>/api/lti/security/jwks
:authorization_endpoint: <canvas base url>/api/lti/authorize
:redirect_uri: <avalon base url>/users/auth/lti/callbackMoodle
Moodle allows for the specification of global as well as course-specific LTI external tools.
LTI 1.1
Follow Moodle’s instructions for adding an LTI external tool and select LTI version 1.1. For Tool URL use the base url for your Avalon instance with /users/auth/lti/callback (e.g. http://localhost:3000/users/auth/lti/callback). The consumer key and shared secret are the values you configured in config/settings.yml. Set the default launch container to new window and under privacy always share the email so Avalon receives both username and email. After adding the LTI external tool you should be able to test it out.
LTI 1.3
Follow Moodle’s instructions for adding an LTI external tool and select LTI version 1.3. For Tool URL use the base url for your Avalon instance (e.g. http://localhost:3000). The initiate login URL should be the Avalon base url with /users/auth/lti (e.g. http://localhost:3000/users/auth/lti) and the redirection URI should be that with /callback (e.g. http://localhost:3000/users/auth/lti/callback). Set the default launch container to new window and under privacy always share the email so Avalon receives both username and email.
After adding the LTI external tool, go to site administration and find the LTI external tool under Manage Tools. Click the magnifier icon to open the modal with the client id and deployment id for the tool. Then edit the auth block in config/settings.yml filling in the client id, deployment id, and base urls. Restart avalon and test out your LTI external tool in Moodle.
- :name: Avalon Lti OAuth
:provider: :lti
:protocol: '1.3'
:hidden: true
:params:
:platforms:
- :issuer: <moodle base url>
:client_id: <client_id>
:deployment_ids: ["<deployment_id>"]
:jwks_uri: <moodle base url>/mod/lti/token.php
:authorization_endpoint: <moodle base url>/mod/lti/certs.php
:redirect_uri: <avalon base url>/users/auth/lti/callbackSakai (old)
To add an external tool to a course, go to site setup on the sidebar then check off the box for one of the external tools. We already named one "Avalon".
It will then show up in the side bar.
Click on it and select the edit button in the upper left hand corner. We used the following settings (replacing <avalon ip address> with your url):
Check the boxes to release the name and email address to the external tool. If these aren't checked, students logging in the first time through sakai will receive an error message.