Celebrate Excellence in Education: Nominate Outstanding Educators by April 15!
We built an application that is hosted on our private server. As of this point, we were able to embed the app using LTI and iframes. The next phase of our application is to dynamically changed the app content based on who's logged in and what course he/she is currently in.
The question is, is it possible to pass parameters (such as course id and student id) to the LTI Launch URL? Instead of "http://app.com/, it would be something like "http://app.com/?course=NNNNN&student=NNNNN" where both course and student values are predetermined by canvas.
That way, we could extract those values via a get parameter and pass it to our application before loading the app in the canvas.
Solved! Go to Solution.
Look at the LTI Variable Substitutions documentation page.
When you add a custom field in the LTI configuration, it gets sent along with the API request.
In the custom fields, the left side is the name you want to use and the right side is the variable substitution, prefaced with a $. For example: course.id=$Canvas.course.id
In the LTI launch request, the fields names (left side of assignment in the custom fields) are prefixed with custom_ and periods are changed to underscores: course.id would become custom_course_id.
Look at the LTI Variable Substitutions documentation page.
When you add a custom field in the LTI configuration, it gets sent along with the API request.
In the custom fields, the left side is the name you want to use and the right side is the variable substitution, prefaced with a $. For example: course.id=$Canvas.course.id
In the LTI launch request, the fields names (left side of assignment in the custom fields) are prefixed with custom_ and periods are changed to underscores: course.id would become custom_course_id.
Wow. That worked. Thank you so much, @James Jones. You just made the day of 10000+ students!
I am also having this issue and I've tried adding the query string params to the launch URL like
https://domain/canvas/courses?course.id=$Canvas.course.id and its not working. When it launches there are no querystring params?
How did you solve it?
For anyone who stumbles upon this question wondering where the data is accessed from. Through the OpenID Connect flow, an id_token is return that is a json web token that contains information from the lti tool about state and info passed the the tool. In the json web token, custom fields are added there.
To participate in the Instructure Community, you need to sign up or log in:
Sign In
This discussion post is outdated and has been archived. Please use the Community question forums and official documentation for the most current and accurate information.