Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple matching kid support #866

Open
cfauchard opened this issue Jan 29, 2024 · 1 comment
Open

Multiple matching kid support #866

cfauchard opened this issue Jan 29, 2024 · 1 comment

Comments

@cfauchard
Copy link

Is there some kind of support for multiple keys sharing the same ID on a JWK ?

Despite not an encouraged practice, this is allowed by the standard, see https://openid.net/specs/openid-financial-api-part-2-1_0.html#duplicate-key-identifiers and of course we're facing this issue (keys with same kid but different alg, the first one is selected regardless of alg).

For now we're locally patching Message.get_verify_keys, KeyBundle.get_key_with_kid, KeyBundle.get_decrypt_key and KeyBundle.get_key_by_kid to retrieve key matching with both kid and alg.

This is straighforward (and I can submit a patch if your OK with this aproach) but doesn't handle all cases exposed by the standard (extract of openid.net specs bellow):

However, to increase interoperability when there are multiple keys with the same kid, the verifier shall consider other JWK attributes, such as kty, use, alg, etc., when selecting the verification key for the particular JWS message.

  1. Do you see another way to handle this case without modifying pyoidc?
  2. Are you interested by supporting this?
    a. Do you wan't me to submit a patch supporting kid disambiguation by alg
    b. Or do you wan't to discuss something more generic

Thanks in advance

@tpazderka
Copy link
Collaborator

The specs you are pointing to are regarding the FAPI which (strictly speking) are not implemented in pyoidc.

But anyway, I am not opposed to a patch that helps to figure out a correct key.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants