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

Handle verification when multiple algorithms are allowed in the settings #421

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jsdt
Copy link

@jsdt jsdt commented Mar 5, 2025

Previously it was possible to allow multiple algorithms in the validation settings, but if multiple families were allowed, verifying would always fail (because it wanted the decoding key to match all of the families). This change supports settings multiple algorithms/families. This will return an error if:

  1. The decoding key doesn't match the family of any of the allowed algorithms,
  2. The algorithm in the token header is not one of the allowed algorithms, or
  3. The algorithm in the token header is not the same family as the decoding key

I added some tests for these cases. I also added decode_token_with_multiple_algorithms_allowed, which would have previously failed.

@Keats
Copy link
Owner

Keats commented Mar 7, 2025

The early error with mixed family is intended. Ideally it would not be possible at all from the Rust API but I haven't got to that yet

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

Successfully merging this pull request may close these issues.

2 participants