iframejupyterhubcanvas-lms

Jupyterhub - iframe in canvas LMS


I have two different servers with one Canvas LMS installed and one JupyterHub.

I include as an external app with LTI JupyterHub in Canvas and setting the configuration:

c.JupyterHub.tornado_settings = {
'headers': {
    'Content-Security-Policy': "frame-ancestors 'self' https://xxxxxxx.yyy"
}}

he problem is that when I click on the "start my server" button (image 1), the iframe is blocked because jupyterhub does not consider it safe.

How do I set the setting "Content-Security-Policy" for the docker and for each jupyterhub user?

I read that there is a jupyter_notebook_config.py file, I tried to set it up but it doesn't seem to work ...

enter image description here


Solution

  • SOLUTION: Add to your jupyterhub_config.py:

    c.Spawner.args = ['--NotebookApp.tornado_settings={"headers":{"Content-Security-Policy": "frame-ancestors * self https://yourwebsitehere.com"}}', '--NotebookApp.disable_check_xsrf=True']
    
    c.JupyterHub.tornado_settings = { 'headers': { 'Content-Security-Policy': "frame-ancestors * self https://yourwebsitehere.com"} }