This code is based on the Canvas LTI redirect tool
To follow the instructions below, you will at minimum need the following:
-
You need to web Proxy like Loophole or ngrok to run the application. Loophole offers custom domain
loophole http 6000 --hostname <your-host>
-
Copy the
.env_samplefile as.env.cp .env_sample .env
-
Examine the
.envfile. It will have the suggested default environment variable settings, mostly just MySQL information as well as locations of other configuration files. -
Edit
.env, referring to the web proxy started above using loophole or ngrok, update the values for the settings…ALLOWED_HOSTS— Add the hostname of the proxy.CSRF_TRUSTED_ORIGINS— Add the base URL of the proxy.
-
Start the Docker build process (this will take some time).
docker compose build
-
Start up the web server and database containers.
docker compose up
-
generate Django secret using below command
python manage.py shell -c "from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())"- Need to run this command once docker container is up in order for LTI to work. This is important step otherwise the LTI tool launch won't happen
docker compose exec -it web ./manage.py rotate_keys - Create superuser using
need to run a proxy like loophole or ngrok for LTI installation and login with that user. Go to https://{app-hostname}/admin/.
docker compose exec -it web ./manage.py createsuperuser - Go to Canvas instance, choose Developer Keys in admin site
- Add LTI Key
- Choose Paste JSON method
- Goto
LTIRegistrationto configure an LTI tool from admin console. This will create theuuidautomatically. Hold on to that value and update theOpenID Connect Initiation Urlin the LTI tool registration from Canvas with this id.for Eg: https://module_import-local.loophole.site/init/0b54a91b-cac6-4c96-ba1e/ - use the
setup/lti-config.jsonfor registing the LTI tool. Replace all the{app-hostname}with your web proxy url and uuid:lti-registration with UUID value from LTI tool registration. - Configure the LTI configuration from module import tool going to admin again. Give the following value. Note:
<canvas-lti-platform>: ['canvas.test', 'canvas.beta', 'canvas']and : [sso.test.canvaslms.com,sso.beta.canvaslms.com,sso.canvaslms.com]. Documentation Domain URL changes- Name: any name
- Issuer: https://.instructure.com
- Client ID: (get this from Platform)
- Auth URL: https://.instructure.com/api/lti/authorize_redirect
- Access token URL: https://.instructure.com/login/oauth2/token
- Keyset URL: https://.instructure.com/api/lti/security/jwks
- DEPLOYMENT ID: get this as it is described the step 7 and paste
- Save
- Go to the Canvas(platform) add the LTI tool at account/course level and copy the deployment id by clicking the setting button next to it.
- go to the
auth_usertable and setis_superuserandis_staffto1ortruethis will give the logged user access to admin interface - In order to access the admin interface for to https:///admin