Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Fixed
-
4.0.6, 4.1.1
-
2
-
Team Hedgehog Sprint 1 review
Description
Issue
firebase/php-jwt 6 made 'alg' a required property, and this causes some issue when tools don't provide this in their JWKS.
Replication steps
We'll use a local moodle tool provider to replicate this. In reality, any tool omitting the JWKS 'alg' property will result in the same failure.
- Set up 2 local Moodle sites - one platform, one tool
- In the tool codebase, edit lib/lti1p3/src/JwksEndpoint.php, commenting out the 'alg' line in getPublicJWKS here: https://github.com/moodle/moodle/blob/6c0ffde138f33490e8f9a34d7d9a60bbbaa71e93/lib/lti1p3/src/JwksEndpoint.php#L43
- See https://docs.moodle.org/401/en/Publish_as_LTI_tool to register the tool site with the platform. At the end of this process you should have registered the tool with the platform and have a new preconfigured tool in the platform site admin.
- In the tool site, create a course with an assignment
- In Course -> Published as LTI tools, publish the assignment over LTI Advantage
- Now, log into the platform site and go to a course
- Click to add a new activity and select the External tool you created in 2.
- Select "Add content" and proceed through any login linking process
- Select the assignment you published in 5.
- Click "Add content"
Expected: the content item message is returned without an error
Actual: You'll see the error "Exception - JWK must contain an "alg" parameter"
Attachments
Issue Links
- is a regression caused by
-
MDL-71712 Upgrade PHP-JWT to latest version
-
- Closed
-