packbackbooks / lti-1-3-php-library

A library used for building IMS-certified LTI 1.3 tool providers in PHP.
Apache License 2.0
39 stars 25 forks source link

ONCALL-718: Differentiate error messaging for public key #91

Closed lin-brian-l closed 1 year ago

lin-brian-l commented 1 year ago

Summary of Changes

This PR adds a different error messages to differentiate between failing to find a public key (when the request to get the key set fails) vs when there isn't a public key matching the JWT. This is to clarify exactly what is causing the error Unable to find public key., which was previously being thrown in two places.

Testing

I copy+pasted my changes to the backend vendor code and verified that, by forcing that exception to be thrown, the error is displayed as expected. I also verified that debugging can be toggled on the service connector by passing true in for the last parameter.

lin-brian-l commented 1 year ago

I tried Davo's suggestion a second time and it worked, so I've reverted my changes to expose functionality to toggle the debug mode.