How do you add multiple Redirect URIs synced from the JSON configuration?

Jump to solution
PocketColin
Partner
Partner

The "target_link_uri" documentation is very confusing when it comes to including multiple URLs. Specifically, the documentation for this value in the JSON config states: "This can be set at the tool-level, or within the "placements" JSON object for placement-specific target_link_uri's". However, if you don't set the value at the tool-level you get an error. I have different URLs for my placements which I have set on the placement level, but when I add the Developer LTI Key and use the URL method, the "Redirect URIs" field is only ever populated with the top level, tool-level URL. There also is no documentation (that I could find) that explains how to separate Redirect URIs in that field but after some testing I found that spaces work. With that knowledge about spaces, I tried setting the tool-level target_link_uri value to include multiple URLs separated by spaces, but throws an error (Configuration error: ["Tool url Incorrect url for..."]). So how do I get multiple URLs to automatically sync into the Redirect URIs field on the Add LTI Key settings page?

Config:

 

{
    "title": "My App",
    "description": "Direct linking to my app.",
    "oidc_initiation_url": "https://some.website/lti/init_login",
    "target_link_uri": "https://some.website/lti/auth",
    "scopes": [],
    "extensions": [
        {
            "domain": "myapp.com",
            "tool_id": "myapp",
            "platform": "canvas.instructure.com",
            "privacy_level": "public",
            "settings": {
                "text": "My App",
                "icon_url": "https://www.myapp.com/logo.svg",
                "windowTarget": "_blank",
                "placements": [
                    {
                        "placement": "course_navigation",
                        "message_type": "LtiResourceLinkRequest",
                        "target_link_uri": "https://some.website/lti/auth",
                        "custom_fields": {
                            "sis_course_id": "$Canvas.course.sisSourceId",
                            "course_id": "$Canvas.course.id"
                        }
                    },
                    {
                        "text": "Specific assignment",
                        "placement": "assignment_selection",
                        "message_type": "LtiDeepLinkingRequest",
                        "target_link_uri": "https://some.website/lti/assignment_selection",
                        "custom_fields": {
                            "sis_course_id": "$Canvas.course.sisSourceId",
                            "course_id": "$Canvas.course.id",
                            "assignment_id": "$Canvas.assignment.id"
                        }
                    }
                ]
            }
        }
    ],
    "custom_fields": {
        "canvas_org_guid": "$ToolConsumerInstance.guid"
    },
    "public_jwk_url": "https://some.website/lti/public_jwk"
}

 

Labels (2)
0 Likes
1 Solution
PocketColin
Partner
Partner

I settled with just using query parameters so I only need one URI in the `target_link_uri` field, but if anyone sees this and has a solution I'd love to hear it. It would be awesome if Instructure could clarify in their docs how this works.

View solution in original post

0 Likes