open-craft / openedx-ltistore

A Django plugin app for Open edX Platform to store LTI Keys centrally
1 stars 2 forks source link

JWKS endpoint returns an empty object instead of the key #6

Open jdmansour opened 5 months ago

jdmansour commented 5 months ago

Hi, when I use this package, the /api/lti_consumer/v1/public_keysets/lti_store/... endpoint returns an empy object {} insead of a public key.

I found the reason is that the function model_to_dict omits all fields with editable=False, thus the lti_1p3_public_jwk field is not set. I posted one possible fix here: https://github.com/jdmansour/openedx-ltistore/tree/fix-lti13 .

I just realized another way would be to remove editable=False and instead use exclude = ('lti_1p3_public_jwk',) in the admin, but I haven't tested it.