tl-its-umich-edu / canvas-app-explorer

A Web application that presents a list of Canvas external (LTI) tools with details. When integrated within Canvas, the user can search for specific LTI tool(s), and add or remove those tools from Canvas courses.
Apache License 2.0
4 stars 6 forks source link

Fixes #147 - Disable existing admin backend and trust LTI for users that are admin #215

Closed jonespm closed 2 years ago

jonespm commented 2 years ago

Because the backdoor to add an initial pylti and super user are removed from this. I'm planning on also updating the Wiki documentation. This significantly simplifies local setup.

Run this command to create an initial PyLTI Key. These are the minimal arguments

These are the minimal values to set. You can run it multiple times to update a previous client_id+issuer pair. To remove you'll have to go into the admin UI or database.

docker exec -it canvas_app_explorer ./manage.py manage_pylti --tool_key="LTI Key" --title="Canvas Test" --client_id=85530000000000126

You can additionally specify --platform (Defaults to canvas.instructure.com) --deployment_ids (Needs to be set unless the .env value LTI_CONFIG_DISABLE_DEPLOYMENT_ID_VALIDATION=True is set) You can specify multiple like --deployment_ids "303:43090cc0c11063fdf5b270094da05ed6e23ea6ad" "100:43090cc0c11063fdf5b270094da05ed6e23ea6ad" These are obtained from the External Apps Page on Canvas

After you set this up, login from Canvas and Authorize the app. You should see the home page.

Then run this to promote yourself or another logged in user initially to staff. (Fill in the UPDATE_USERNAME= part)

UPDATE_USERNAME="jonespm@umich.edu";docker exec -it canvas_app_explorer ./manage.py shell -c "from django.contrib.auth.models import User; User.objects.update_or_create(username='$UPDATE_USERNAME', defaults=dict(is_superuser=True, is_staff=True))"

After the first time doing this you can login as a user and promote through the admin UI and the link.

jonespm commented 2 years ago

215 should be merged or rejected before this is merged as this includes that commit.