-
Notifications
You must be signed in to change notification settings - Fork 51
Testing LTI integration with Canvas
Phil Dinh edited this page Dec 7, 2017
·
9 revisions
This guide will walk you through how to setup the Canvas Learning Management System (LMS) and configure your Avalon development environment in order to test integration through LTI (Learning Tools Interoperability).
docker run -d --name canvas-docker -p 80:3000 -d lbjay/canvas-docker
- Uncomment the LTI authentication block under development in config/authentication.yml so it looks like:
- :name: Avalon Lti OAuth :provider: :lti :hidden: true :params: :oauth_credentials: key: 'secret'
- Create your own key/secret pair in config/authentication.yml to replace
key: 'secret'
- Start your rails server:
bundle exec rake hydra:server
- Login to Canvas The Canavs docker container has default credentials of [email protected] / canvas-docker
- Create a Course
Click
Start a New Course
and fill out the form - Setup an External Tool
- In the new course, go to Settings
- Click the Apps tab
- Click the
+App
button - Fill out the form with a name, the key/secret pair you made before, and a Launch URL that points to your Avalon instance:
http://127.0.0.1:3000/users/auth/lti/callback
- Add the External Tool to a Module
- Go to Modules
- Create a new Module
- Click the
+
button within your new module- Select
External Tool
from the dropdown menu - Fill in the Launch URL from above and give it a name
- Click
Add Item
- Select
- Click on the new item inside the module created
- Look in the rails log for the request logging and find
tool_consumer_instance_guid
:Started POST "/users/auth/lti/callback" for XXX.XXX.XXX.XXX at 2017-08-23 15:39:18 -0400 ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" (lti) Callback phase initiated. Processing by Users::OmniauthCallbacksController#lti as HTML Parameters: {"oauth_consumer_key"=>"fluorine", "oauth_signature_method"=>"HMAC-SHA1", "oauth_timestamp"=>"1503517158", "oauth_nonce"=>"m4TOyaq7EfisyxfO0t1Ws6WBY8ZHllJoL7IjbFpRo", "oauth_version"=>"1.0", "context_id"=>"4dde05e8ca1973bcca9bffc13e1548820eee93a3", "context_label"=>"Course", "context_title"=>"Course LTI Test", "custom_canvas_enrollment_state"=>"active", "ext_roles"=>"urn:lti:instrole:ims/lis/Administrator,urn:lti:instrole:ims/lis/Instructor,urn:lti:role:ims/lis/Instructor,urn:lti:sysrole:ims/lis/SysAdmin,urn:lti:sysrole:ims/lis/User", "launch_presentation_document_target"=>"iframe", "launch_presentation_locale"=>"en", "launch_presentation_return_url"=>"http://localhost/courses/1/external_content/success/external_tool_redirect", "lti_message_type"=>"basic-lti-launch-request", "lti_version"=>"LTI-1p0", "oauth_callback"=>"about:blank", "resource_link_id"=>"6a8aaca162bfc4393804afd4cd53cd94413c48bb", "resource_link_title"=>"Avalon", "roles"=>"Instructor,urn:lti:instrole:ims/lis/Administrator", "tool_consumer_info_product_family_code"=>"canvas", "tool_consumer_info_version"=>"cloud", "tool_consumer_instance_contact_email"=>"[email protected]", "tool_consumer_instance_guid"=>"794d72b707af6ea82cfe3d5d473f16888a8366c7.localhost:3000", "tool_consumer_instance_name"=>"Canvas Docker", "user_id"=>"535fa085f22b4655f48cd5a36a9215f64c062838", "oauth_signature"=>"wfFeHrWuRtQRvEpCun3oexjmtDU="} Attempting to find user with lti strategy
- Copy
config/lti.yml.example
toconfig/lti.yml
- Edit
config.yml
replacing<lms guid>
with thetool_consumer_instance_guid
found above and with the settings below:794d72b707af6ea82cfe3d5d473f16888a8366c7.localhost:3000: :uid: :tool_consumer_instance_contact_email :email: :tool_consumer_instance_contact_email :context_id: :context_label :context_name: :context_label
- Restart the rails server
Go back to Canvas and try the link within the module. If successful, Avalon should load within an iframe logged in as [email protected]
and performing a query for the course as an External Group facet search.
Student accounts can be created by going to a Course
, then People
> + People
, fill out the necessary info. After a student has been created, click on their name and click Become
to masquerade as that student.