Repository navigation
Verify-or-error decode without JWKS, discovery issuer pinning - #96
Merged
Merged
Conversation
kilork
force-pushed
the
fix-92-jwks-verification-issuer-pinning
branch
from
October 4, 2026 19:36
91c719a to
435de63
Compare
- Client::decode_token now returns a new Decode::MissingJwks error instead of
silently returning Ok on an unverified token when no JWK set is configured
- discovered::discover validates that the issuer of the discovered provider
configuration matches the requested issuer, per OIDC Discovery 3.1.2.2,
with the Microsoft {tenantid} template accepted as a wildcard segment
- the same check is applied to UMA2 discovery
Contributes to #92
The generic discovery no longer accepts the Microsoft {tenantid} issuer
template: provider-specific non-compliance belongs in the provider
feature, like microsoft skipping issuer validation today. Generic
pinning is an exact match per OIDC Discovery 3.1.2.2.
Contributes to #92
kilork
force-pushed
the
fix-92-jwks-verification-issuer-pinning
branch
from
October 4, 2026 20:04
435de63 to
59847ee
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements the first two findings of #92:
Client::decode_tokenreturnsOkfor unverified tokens whenclient.jwks == None— replaced with a newDecode::MissingJwkserror. Non-breaking in practice:validate_token/authenticatealready failed afterwards atpayload().discovered::discovernow pinsconfig.issuerto the requested issuer (OIDC Discovery 3.1.2.2) — exact match. Same check in UMA2 discovery.Provider-specific non-compliance stays in provider features, like Microsoft's issuer-skipping
microsoft::authenticatetoday: the{tenantid}template issuer is deliberately not special-cased in generic discovery. Multi-tenant Microsoft apps:microsoftfeature (itsvalidate_tokenskips the issuer check),Discovered::from) — the same path used for other non-compliant providers in Please move discovered::jwks to be a public API #88.Follow-up for a proper Microsoft multi-tenant solution (issuer template vs
tidclaim instead of skipping the check entirely) is tracked in #70/#7.Remaining item of #92: https enforcement for token/userinfo/introspection + per-client opt-out design — will follow in a stacked PR.