Hi all, I am trying to create an
LTI provider with grade reporting. I ran into a problem using Moodle 2.7 where I kept getting an error about "Consumer key is missing.", using the Python oauth2 library. Several other posts on this forum (from 2012 to 2014) also mention issues with this kind of error, but do not specify what language / OAuth / LTI library they are using. I tracked this down to Moodle's mod/lti/service.php and would like to propose a fix to make the LTI grade reporting more robust.
On line 38, a check on the headers is performed:
if ($name === 'Authorization') { <do something> }
This was failing for me because between my OAuth library and Moodle, the header names were getting
lowercased !! Hence no "Authorization" header found, no Consumer key, etc. I suspect others are experiencing the same error. I would propose something like the following to make this more robust and less frustrating:
if (strtolower($name) === 'authorization') { <do something> }