Moodle Exception - public key

Moodle Exception - public key

by Eduardo Sousa Silva -
Number of replies: 5
Hello people!
I have an error in my Moodle provider, Every time I try to publish a course as an external LTI tool and when accessing it through the consumer, this error appears on the screen when clicking on the course.
Exception - Unable to find public key.

Other information about this error

Debug info:
Error code: generalexceptionmessage×Ignore this notification

Stack tracking:

  • line 316 of /lib/lti1p3/src/LtiMessageLaunch.php: Packback\Lti1p3\LtiException thrown
  • line 455 of /lib/lti1p3/src/LtiMessageLaunch.php: call to Packback\Lti1p3\LtiMessageLaunch->getPublicKey()
  • line 149 of /lib/lti1p3/src/LtiMessageLaunch.php: call to Packback\Lti1p3\LtiMessageLaunch->validateJwtSignature()
  • line 71 of /enrol/lti/launch.php: call to Packback\Lti1p3\LtiMessageLaunch->validate()
What could it be ? thanks smile Follow the attachment
Attachment MicrosoftTeams-image (1).png
Average of ratings: -
In reply to Eduardo Sousa Silva

Re: Moodle Exception - public key

by Eduardo Sousa Silva -
PS: My connection between both was working fine until a week ago, so I'm thinking that it's a moodle configuration that could be causing this error. By the way, I had to change the site certificate for reasons of expiration
In reply to Eduardo Sousa Silva

Re: Moodle Exception - public key

by Jake Dallimore -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Hi Eduardo,

That error simply means the tool site was unable to connect to the platform's JWKS endpoint to get the public key. Have you configured the tool properly with all the relevant platform details, including the JWKS endpoint? Is that endpoint publicly accessible? (it should be).

Cheers,
In reply to Jake Dallimore

Re: Moodle Exception - public key

by Eduardo Sousa Silva -
In reply to Eduardo Sousa Silva

Re: Moodle Exception - public key

by Eduardo Sousa Silva -

News!

I think I found out what might be happening, doing some tests on my other moodles that are already on the air, I found out that the ones that work with the LTI tool are from versions 4.1.5.

When I uploaded moodle to my server with version 4.2.2+ I didn't pay attention to testing the external tool.

Could there be a bug in version 4.2.2 for the external tool?

I followed this documentation to create my moodle provider and consumer -> if possible, can we update this documentation to the latest version of moodle (this if creating the external tool in 4.2.2 is ok)?

In reply to Jake Dallimore

Re: Moodle Exception - public key

by Saul Rioja -

Hi I have been trying to connect two Moodles (4.3.3) One is configured as a platform and the other is configured as a tool. My Moodles are running in Docker on Mac. 
I have the same problem (Unable to find public key), I tried everything I could, any help will be greatly appreciated image.png

image%20%281%29.png