Skip to content

Clarify that propagate_claims sends missing claims as empty headers - #323

Merged
thedae merged 1 commit into
masterfrom
fix/jwt-propagate-missing-claims
Nov 26, 2026
Merged

thedae merged 1 commit into
masterfrom
fix/jwt-propagate-missing-claims

Conversation

@thedae

@thedae thedae commented Nov 26, 2026

Copy link
Copy Markdown
Member

The JWT validation page said that when a claim listed in propagate_claims is missing from the token "the mapping is just skipped", which reads as if a header sent by the client would reach the backend untouched. KrakenD does the opposite: it always sets the propagated header, with the claim value when it exists and empty when it doesn't, so a client-supplied value for that header never gets through. This rewrites the paragraph after the example to say so, adds a CEL check (has(JWT.sub)) for rejecting tokens that lack the claim, and documents how array claims are propagated (comma-separated, or one value each with propagate_claims_preserve_array). Nothing changes in the product; it's a docs fix.

The behaviour is the same in every version: HeadersToPropagate in krakend-jose writes "" for a missing claim and the router applies it with Header.Set, in v2.12.5, v3.0.3 and master. It was also reproduced black-box with krakend e2e on EE 2.10.4, 2.13.1 and 3.0.5: a token with sub but no roles, plus X-User-Roles: admin from the client, reaches the backend as X-User-Roles: "".

Also: the header names in that paragraph are now written as X-User and X-Role to match the example.

@thedae
thedae merged commit 5df87ef into master Nov 26, 2026
3 checks passed
@thedae
thedae deleted the fix/jwt-propagate-missing-claims branch November 26, 2026 09:37
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