Embeddable LTI app from Rich Content Editor- how to get user id?

338 views
Skip to first unread message

thelas...@gmail.com

unread,
Nov 10, 2012, 7:30:19 PM11/10/12
to canvas-l...@googlegroups.com
Hello everyone,

I have an LTI app that I made RCE enabled (https://canvas.instructure.com/doc/api/file.editor_button_tools.html) and configured as an iframe. However, when loading the iframe I am not passed any information that would allow me to know what the custom canvas user id of the user who is loading it. This makes it impossible to associate session data with RCE loaded iframes. Am I missing an RCE option that allows embedding LIT apps as an iframe but also passes along some information about the user/context?

Thanks,
Shayne

Christopher Bennell

unread,
Nov 16, 2012, 11:21:47 AM11/16/12
to canvas-l...@googlegroups.com, thelas...@gmail.com
Hi Shayne, how are you checking for passed parameters?

thelas...@gmail.com

unread,
Nov 16, 2012, 11:27:35 AM11/16/12
to canvas-l...@googlegroups.com, thelas...@gmail.com
Hi Christopher- Since my page is being loaded as an iframe, I only expected query string params. Should I check something else?

Basically what I would love to have is an embed_type=lti_iframe that does the LTI handshake as part of the process, but I'd take any embed_type that lets me know the user that is viewing it.

Shayne

Christopher Bennell

unread,
Nov 16, 2012, 11:35:44 AM11/16/12
to canvas-l...@googlegroups.com, thelas...@gmail.com
Check the post params. This is how params are passed when you add an LTI tool as a navigation item, I assume it's the same with RTE buttons. 

thelas...@gmail.com

unread,
Nov 16, 2012, 11:39:31 AM11/16/12
to canvas-l...@googlegroups.com, thelas...@gmail.com
I can check but I doubt it. The post params for nav items are part of the initial LTI handshake process.., there is no handshake for embedded RCE content, it's just a straight url load. I have just about every type of LTI integration running trying to make this work, but I don't think it is an option with Canvas at this time.

Austin Bart

unread,
Aug 31, 2016, 1:23:26 AM8/31/16
to Canvas LMS Users, thelas...@gmail.com
Wait, so is this actually a thing? If I embed an IFrame or a link to my LTI tool in a Page or the body of an Assignment/Quiz/etc., then I can't get access to any LTI data? It looks like you can get LTI info from the Resource Select page and the Editor Page, but those are just for the instructor. I can't use this to find out the currently logged in student??

~Cory

Christopher Bennell

unread,
Aug 31, 2016, 11:21:05 AM8/31/16
to Canvas LMS Users, thelas...@gmail.com
The page in the iframe could make an AJAX API request to "https://[your.canvas.com]/api/v1/users/self" to determine the logged-in user. You will get their name, SIS ID, SIS Login, Canvas ID and some other info.

function reqListener () {
  console.log(this.responseText);
}
var req = new XMLHttpRequest();
req.addEventListener("load", reqListener);
req.send();

Austin Bart

unread,
Aug 31, 2016, 2:27:57 PM8/31/16
to Canvas LMS Users, thelas...@gmail.com
Hm, I suppose that would work for some use cases. I have to think about whether I am okay with relying on the Canvas API for such situations. Thanks!

~Cory
Reply all
Reply to author
Forward
0 new messages