Skip to content

feat: validate the issuer and cache signing keys in the OIDC provider - #241

Merged
Jamyn merged 2 commits into
mainfrom
feat/entra-oidc-authentication
Aug 20, 2026
Merged

Jamyn merged 2 commits into
mainfrom
feat/entra-oidc-authentication

Conversation

@Jamyn

@Jamyn Jamyn commented Aug 20, 2026

Copy link
Copy Markdown
Owner

The PKCE provider never validated iss, and Entra ID signs every tenant's tokens from a shared key set — so a tenant-scoped JWKS URL isolated nothing and aud only held while an app registration stayed single-tenant. It also refetched the JWKS on every authenticated request, and returned an unauthenticated 500 for any bearer token that was not a JWT.

Adds issuer validation, a JWKS cache that refreshes on an unknown kid, required exp/aud, clock-skew leeway, and 401s on every malformed-credential path. No new provider, no new dependency, no frontend change — Entra is configuration.

Operators: set DISPATCH_AUTHENTICATION_PROVIDER_PKCE_ISSUER (a startup warning fires if unset). DISPATCH_PKCE_DONT_VERIFY_AT_HASH now rejects non-boolean values at startup instead of treating them as true — =false previously disabled the check. See docs/docs/administration/settings/authentication-entra-id.mdx.

Jamyn added 2 commits August 20, 2026 03:20
The PKCE provider never passed an expected issuer to the token decode.
Microsoft Entra ID signs every tenant's tokens from a shared key set, so
a tenant-scoped JWKS URL isolates nothing and the audience check only
holds while an app registration stays single-tenant.

It also refetched the key set on every authenticated request, and reached
an unguarded b64decode, json.loads and requests.get, so a bearer token
that was not a JWT returned an unauthenticated 500.
@Jamyn Jamyn added enhancement New feature or request security Security hardening or vulnerability remediation labels Aug 20, 2026
@codecov

codecov Bot commented Aug 20, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.66667% with 7 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/dispatch/config.py 41.66% 7 Missing ⚠️

📢 Thoughts on this report? Let us know!

@Jamyn
Jamyn merged commit 58e3ddf into main Aug 20, 2026
15 of 16 checks passed
@Jamyn
Jamyn deleted the feat/entra-oidc-authentication branch August 20, 2026 03:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request security Security hardening or vulnerability remediation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant