Canvas crashes from deep linking response: undefined method `count' for nil:NilClass
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am working on building an assignment selection placement deep linking item for Canvas and am running into an issue where when I submit the deep linking message back to Canvas from the external tool iframe, I get the following error (see screenshot):
NoMethodError in Lti::IMS::DeepLinkingController#deep_linking_response
undefined method `count' for nil:NilClass
This posted message is being sent to the `deep_link_return_url` as defined in the deep linking request message. The data being sent includes a `data` value (automatically included in the url query params), `course_id` (also in url query params), and the `jwt` which is a JWT token of my payload signed with my private JWK (generated RSA 2048).
I've removed any private information from the payload so I could also share the JWT:
eyJhbGciOiJSUzI1NiIsImtpZCI6IjIwMjMtMTEtMzBUMTk6NTg6MTVaIn0.eyJleHAiOjE3MDE0NjY3NjIsImlhdCI6MTcwMTM4MDM2MiwiaXNzIjoiaHR0cHM6Ly9jYW52YXMuaW5zdHJ1Y3R1cmUuY29tIiwiYXVkIjoiMTAwMDAwMDAwMDAwMTciLCJub25jZSI6InlpTk5MbHBaa2xOWVZVdW5SSkFQWlVOelp1bnh0aCIsImF6cCI6IjEwMDAwMDAwMDAwMDE3IiwiaHR0cHM6Ly9wdXJsLmltc2dsb2JhbC5vcmcvc3BlYy9sdGkvY2xhaW0vZGVwbG95bWVudF9pZCI6IjEwOjRkZGUwNWU4Y2ExOTczYmNjYTliZmZjMTNlMTU0ODgyMGVlZTkzYTMiLCJodHRwczovL3B1cmwuaW1zZ2xvYmFsLm9yZy9zcGVjL2x0aS9jbGFpbS9tZXNzYWdlX3R5cGUiOiJMdGlEZWVwTGlua2luZ1Jlc3BvbnNlIiwiaHR0cHM6Ly9wdXJsLmltc2dsb2JhbC5vcmcvc3BlYy9sdGkvY2xhaW0vdmVyc2lvbiI6IjEuMy4wIiwiaHR0cHM6Ly9wdXJsLmltc2dsb2JhbC5vcmcvc3BlYy9sdGktZGwvY2xhaW0vY29udGVudF9pdGVtcyI6W3sidHlwZSI6Imx0aVJlc291cmNlTG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QxGijAJunBsLK0_Z0OFhHK8E4mZlm28aVj5uqPcTlFD5TSyu2JniNwPGSSB4B5sORLTPuzbw3onQ","kid":"2023-11-30T19:58:15Z"}
If you plug those into https://jwt.io/#debugger-io you can see that the token verifies and there is an iss value.
Does anyone know what this error message is referring to?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
omg I'm going to chuck my laptop out the window. The name of the field needs to be `JWT` not `jwt`. 😠