Skip to content

Fix unknown kid handling in JWKS refresh - #563

Merged
maennchen merged 7 commits into
mainfrom
fix/jwks-unknown-kid-refresh
Oct 26, 2026
Merged

maennchen merged 7 commits into
mainfrom
fix/jwks-unknown-kid-refresh

Conversation

@maennchen

Copy link
Copy Markdown
Member

has_kid/2 compared only the first key in the set, and it crashed the worker on a key without kid. The key set folds in verify_signature/3 and decrypt/4 let the kid error of an unrelated key hide the real error of the key the token selects. Decryption failures for a known kid were also reported as unknown kid. These errors caused JWKS refreshes that were not necessary.

from_configuration_worker/4 resolved registered names to a pid, which skipped the ETS read path. The worker now also drops unknown-kid refresh requests that were queued while a fetch ran, so concurrent requests cause one fetch.

maennchen and others added 7 commits October 26, 2026 17:28
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@maennchen
maennchen merged commit bb02c18 into main Oct 26, 2026
28 checks passed
@maennchen
maennchen deleted the fix/jwks-unknown-kid-refresh branch October 26, 2026 17:05
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.

1 participant