instructure / ims-lti

A Ruby library to help implement IMS LTI tool consumers and providers
MIT License
199 stars 122 forks source link

disable course navigation by default #148

Closed ahmadhasankhan closed 6 years ago

ahmadhasankhan commented 6 years ago

Hi, I am new Canvas and LTI. I just started working on an LTI 2.0 app.

I am able to launch the app but the problem is that it is enabled for all courses. By default, course navigation should be disabled and the teacher should explicitly enable it.

  1. Set course_navigation[default] to disabled while launching.
  2. Use external_tools API to update it

api/v1/accounts/{id}/external_tools/{id} Now if i just want to update the app after launch then the issue is that I don't see the app in the external_tools list API which I launched using LTI-2 however, I am getting those apps which i am launching using this API

curl -X POST '{host}/api/v1/accounts/1/external_tools' \
-H "Authorization: Bearer {Tocken]" \
-F 'name=LTI Example' \
-F 'consumer_key=asdfg' \
-F 'shared_secret=lkjh' \
-F 'url=https://example.com/ims/lti' \
-F 'privacy_level=name_only' \
-F 'course_navigation[default]=disabled' \
-F 'course_navigation[text]=LTI Test' \
-F 'course_navigation[enabled]=true' \
-F 'user_navigation[visibility]=public'

So

  1. Is there a method or parameter that I can use to disable the course navigation by default while launching the app?

  2. Why external_tools list API is not returning apps which are launched using ims-lti gem?

The behavior is reproducible using this https://github.com/instructure/lti_tool_provider_example app

Thank you.

rivernate commented 6 years ago

There isn't any visibility support in the Canvas LTI2 implementation, and due to the LTI2 spec being deprecated by IMS we are not doing any feature work around it in canvas.

ExternalTools only represent LTI 1 tools, LTI2 tools use a construct called a "ToolProxy" which is by definition of the spec immutable once created. There is not a way for the settings of LTI2 tools to be changed once installed.

Until the next version of LTI is released by IMS I'd recommend using LTI 1.x and avoiding LTI 2.0

abutterf commented 6 years ago

Currently, LTI 2.x tools aren't able to be defaulted to disabled like LTI 1.x tools are. We just haven't added the functionality into Canvas and because IMS Global has deprecated LTI 2.x we will probably not be adding that functionality into Canvas in the future. As far as the external_tools API it only concerns LTI 1.x tools so you won't be able to retrieve information about LTI 2.x tools from that set of endpoints. The LTI 2.x standard laid out a tool proxy service that we have implemented that would allow you to pull down information about your LTI 2.x tool proxy but I'm not sure where IMS has put the documentation for that service.

I would discourage you from implementing an LTI 2.x tool and either encourage you to use LTI 1.x or wait for IMS to release LTI 1.3 which will work with the new LTI Advantage services https://www.imsglobal.org/lti-advantage-overview

ahmadhasankhan commented 6 years ago

Thanks a lot for the response @rivernate @abutterf