ltijs icon indicating copy to clipboard operation
ltijs copied to clipboard

Access original `valid` token

Open lumenlunae opened this issue 11 months ago • 0 comments

Thank you for this library! We are working with grade reporting as an LTI tool, where the platform is Moodle.

They have a "grade analysis" link that instructors can click to link into the tool for grade reporting. With the 6.0.0-alpha.2 I was able to get onSubmissionReview working which was amazing 🙏

The problem I have now is there is no reference back to the user whose grade I'm trying to review. The LTI token only refers to the instructor's user ID. Worst case I can point to a page of all students and the instructor will have to click through to their specific student one more time.

But I see in the original LTI token there exists a claim "https://purl.imsglobal.org/spec/lti/claim/for_user": { "user_id": "29" } which is exactly what I need.

In Provider.js this is the valid variable which gets massaged into a lot of different contexts. Is there anything stopping us from including something like res.locals.original_lti_token = valid; in Provider.js:sessionValidator:397 ?

This issue was opened and closed without much more explanation: https://github.com/Cvmcosta/ltijs/issues/154 -- I'm not really seeing the ramifications of just allowing the original token to be included for access if we need it, which would also help in a future case where a platform might upgrade or change their LTI information and we'll have access to it without needing an ltijs update.

Happy to add as a PR if this is an okay direction to go in. Thank you!

lumenlunae avatar May 03 '25 01:05 lumenlunae