LTI App - missing post params - custom_canvas_course_id and custom_canvas_api_domain

Jump to solution
gmolter
Community Novice

Hi,

I'm trying to build an LTI app that extends the features currently offered in the course view. It needs to be available in every courses and work on multiple instances of Canvas (both self-hosted and instructure hosted).

I was able to add my app (on a instructure hosted instance) and it now displays in the course profile menu for admins like I wanted it to do.

I noticed that when my app is originally loaded canvas POST a whole bunch of information back to my app which is what you would expect. However I can't find a documented/preferred way :

a) to identify which instance of Canvas is loading the app. I suppose I should rely on the oauth_consumer_key. However how do I get to know the API url/path from that?

b) to identity from which course my app is currently being displayed in. According to some LTI documentation that should be the context_id. But at least in the instructure hosted instances the context_id is an MD5 hash that can't be reused in API calls.

Thank you for your help!

Labels (2)
1 Solution

Guillaume, is your tool public?  It looks like the "custom_canvas_api_domain" may only be returned for public tools.  I had to peak into the Canvas code.   It will be in canvas/gems/lti_outbound/lib/lti_outbound/tool_launch.rb, if you have your own copy.   Or you can browse to it here: canvas-lms/tool_launch.rb at stable · instructure/canvas-lms · GitHub 

(I may be wrong though - just guessing from the snippet I'm seeing on line 101...

View solution in original post