LTI 1.3 resource_selection not working as expected

116086425434479
Community Member

I have a placement of resource_selection setup but can't seem to get Canvas to use the link. Here are the claims for the initial request.

{
    "https://purl.imsglobal.org/spec/lti/claim/message_type": "LtiResourceLinkRequest",
    "https://purl.imsglobal.org/spec/lti/claim/version": "1.3.0",
    "https://purl.imsglobal.org/spec/lti/claim/resource_link": {
        "id": "4dde05e8ca1973bcca9bffc13e1548820eee93a3",
        "description": null,
        "title": "Spanish",
        "validation_context": null,
        "errors": {
            "errors": {}
        }
    },
    "aud": "10000000000001",
    "azp": "10000000000001",
    "https://purl.imsglobal.org/spec/lti/claim/deployment_id": "1:b82229c6e10bcb87beb1f1b287faee560ddc3109",
    "exp": 1676961699,
    "iat": 1676958099,
    "iss": "https://canvas.instructure.com",
    "nonce": "eea019e7-f902-473f-be37-fe8a2cf038b4",
    "sub": "758359d4-8dbe-4b4a-9813-7e99a384e2a6",
    "https://purl.imsglobal.org/spec/lti/claim/target_link_uri": "https://test1.ngrok.io/_lti/content-item-selection",
    "picture": "http://canvas.instructure.com/images/messages/avatar-50.png",
    "email": "teacher1@canvas.com",
    "name": "Teacher 1",
    "given_name": "Teacher",
    "family_name": "1",
    "https://purl.imsglobal.org/spec/lti/claim/lis": {
        "person_sourcedid": null,
        "course_offering_sourcedid": null,
        "validation_context": null,
        "errors": {
            "errors": {}
        }
    },
    "https://purl.imsglobal.org/spec/lti/claim/context": {
        "id": "4dde05e8ca1973bcca9bffc13e1548820eee93a3",
        "label": "SP-101",
        "title": "Spanish",
        "type": [
            "http://purl.imsglobal.org/vocab/lis/v2/course#CourseOffering"
        ],
        "validation_context": null,
        "errors": {
            "errors": {}
        }
    },
    "https://purl.imsglobal.org/spec/lti/claim/tool_platform": {
        "guid": "GMckBUetXitVS8yJ8IlpfASxAuf705wiV3pkdAeQ:canvas-lms",
        "name": "Formative",
        "version": "cloud",
        "product_family_code": "canvas",
        "validation_context": null,
        "errors": {
            "errors": {}
        }
    },
    "https://purl.imsglobal.org/spec/lti/claim/launch_presentation": {
        "document_target": "iframe",
        "return_url": "http://canvas.docker/courses/1/external_content/success/external_tool_dialog",
        "locale": "en-GB",
        "height": 400,
        "width": 800,
        "validation_context": null,
        "errors": {
            "errors": {}
        }
    },
    "locale": "en-GB",
    "https://purl.imsglobal.org/spec/lti/claim/roles": [
        "http://purl.imsglobal.org/vocab/lis/v2/institution/person#Instructor",
        "http://purl.imsglobal.org/vocab/lis/v2/membership#Instructor",
        "http://purl.imsglobal.org/vocab/lis/v2/system/person#User"
    ],
    "https://purl.imsglobal.org/spec/lti/claim/custom": {},
    "https://purl.imsglobal.org/spec/lti-ags/claim/endpoint": {
        "scope": [
            "https://purl.imsglobal.org/spec/lti-ags/scope/lineitem",
            "https://purl.imsglobal.org/spec/lti-ags/scope/lineitem.readonly",
            "https://purl.imsglobal.org/spec/lti-ags/scope/result.readonly",
            "https://purl.imsglobal.org/spec/lti-ags/scope/score",
            "https://canvas.instructure.com/lti-ags/progress/scope/show"
        ],
        "lineitems": "http://canvas.docker/api/lti/courses/1/line_items",
        "validation_context": null,
        "errors": {
            "errors": {}
        }
    },
    "https://purl.imsglobal.org/spec/lti-nrps/claim/namesroleservice": {
        "context_memberships_url": "http://canvas.docker/api/lti/courses/1/names_and_roles",
        "service_versions": [
            "2.0"
        ],
        "validation_context": null,
        "errors": {
            "errors": {}
        }
    },
    "https://purl.imsglobal.org/spec/lti/claim/lti11_legacy_user_id": "86157096483e6b3a50bfedc6bac902c0b20a824f",
    "https://purl.imsglobal.org/spec/lti/claim/lti1p1": {
        "user_id": "86157096483e6b3a50bfedc6bac902c0b20a824f",
        "validation_context": null,
        "errors": {
            "errors": {}
        }
    },
    "errors": {
        "errors": {}
    },
    "https://www.instructure.com/placement": "resource_selection"
}

 

Here is the signed message, which is posted back to Canvas as "JWT" as a value in hidden form.

{
    "iss": "10000000000001",
    "aud": "https://canvas.instructure.com",
    "nonce": "4f471804-fcf7-480d-8384-e96c02889f7e",
    "https://purl.imsglobal.org/spec/lti/claim/deployment_id": "1:b82229c6e10bcb87beb1f1b287faee560ddc3109",
    "https://purl.imsglobal.org/spec/lti/claim/message_type": "LtiDeepLinkingResponse",
    "https://purl.imsglobal.org/spec/lti/claim/version": "1.3.0",
    "https://purl.imsglobal.org/spec/lti-dl/claim/content_items": [
        {
            "type": "ltiResourceLink",
            "title": "Untitled Formative",
            "url": "https://test1.ngrok.io/formatives/63f3d788b3255db4ce94d83e",
            "lineItem": {
                "label": "Untitled Formative",
                "scoreMaximum": 100
            }
        }
    ]
}

 

Anyone have any ideas here or able to point me in the right direction?

One thing I'm not really sure about is where to POST this form. I've been using the return_url in the launch presention claim, but I'm not really sure if that's correct. There error I get after the form POST's is "Error: The tool returned an invalid content type "ContentItem"" I included a screenshot of what I see.

0 Likes