joseph_jay_will
Community Novice

Safari and LTI issues in a Django LTI Provider

We're having issues with the Safari browser not working for an LTI app written in python using Django. The code is viewable at https://github.com/kunanit/adaptive-mooclet-lti. Specifically, when we try to launch an LTI session, users using Safari occasionally are not logged in in our launch_quiz view

 

Does anyone have any advice from dealing with issues they've encountered with Safari and LTI in the past?

 

 

 

Can you point us to articles online or stackoverflow questions that might help shed some light on this issue?

 

It would be great if anyone can share code for LTI apps (on github or elsewhere) which explicitly support Safari, especially if they're written in python.

 

Thanks

Labels (1)
Tags (2)
1 Reply
justinball
Community Novice

Hi Joseph,

Does your application use cookies for sessions for something else? If so then you will have a problem with Safari and a few other browsers. The issue is that Safari blocks cookies for iframed websites that the user has never visited outside of an iframe.

We've used various hacks in the past to get around the problem including redirecting the user to our site with the current Canvas url and then redirecting them back to Canvas. They don't really notice the redirect but it's enough for Safari to agree to let you write a cookie. I've soon other people pop up a new window with a close button so that Safari will record that they have visited the website. Both of those feel a bit hackish but they work.

It's not python but we created an LTI starter app using Ruby on Rails: GitHub - atomicjolt/lti_starter_app

Our approach is to use single page apps. As long as the page doesn't reload we are able to maintain state in the client use jwt tokens. The app also includes a mechanism for storing the state when doing the OAuth dance to get a Canvas token.

Justin