Brightspace / D2L.Security.OAuth2

Brightspace OAuth 2.0 for C#
Apache License 2.0
7 stars 16 forks source link

LFT-1285 - Ignore use=enc JWKs in JWKS parsing #364

Closed j3parker closed 1 month ago

j3parker commented 1 month ago

We never have use=enc keys and so our parsing throws when it encounters them.

We don't distinguish between unparsable keys vs. keys that we don't want to use for signing (e.g. use=enc, but also other constraints we impose like having a suitable kty, kid etc.)

In an ideal world I think we would push more of that logic out a bit and parse more keys, ignoring ones that aren't relevant to us anyway and emitting errors in a more sensible location.

This PR makes the minimal change possible to allow us to parse a JWKS response that includes a use=enc key that we will otherwise not need. This is needed for interoperability with LTI vendors that have a JWKS URL serving multiple purposes.