Skip to content

[backport camel-4.14.x] CAMEL-23525: Add optional JWT issuer and audience claim validation - #25196

Merged
oscerd merged 2 commits into
apache:camel-4.14.xfrom
oscerd:backport/CAMEL-23525-4.14.x
Jul 29, 2026
Merged

[backport camel-4.14.x] CAMEL-23525: Add optional JWT issuer and audience claim validation#25196
oscerd merged 2 commits into
apache:camel-4.14.xfrom
oscerd:backport/CAMEL-23525-4.14.x

Conversation

@oscerd

@oscerd oscerd commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Backport of 010bcd575ebd (originally #23389) to camel-4.14.x (→ 4.14.9).

Adds jwtIssuer and jwtAudience to the embedded HTTP server and the management server. When either is set, a JWTOptions carrying those values is attached to the JWTAuthOptions passed to JWTAuth.create, so the iss and aud claims are validated in addition to the signature and the expiry. jwtAudience accepts a comma-separated list and a token is accepted if its aud claim matches any configured value.

Why on a maintenance branch

Without these options a JWT authenticator on this branch validates the signature and expiry only, and there is no configuration that changes that. This backport gives operators on 4.14.9 a way to constrain which issuer and audience are accepted. The related fail-closed change (CAMEL-24281, #25187) is deliberately not backported, since it would be a startup-breaking change here.

Compatibility

Additive only. Both options default to null, buildJwtOptions returns null when both are empty, and the caller then skips setJWTOptions, so an existing configuration builds the authenticator exactly as before. The new methods on HttpServerConfigurationProperties and HttpManagementServerConfigurationProperties are additive and binary compatible.

The pre-existing keystore-only JWTAuthenticationMainHttpServerTest passes unchanged on this branch, which is the compatibility check that matters here.

Notes

  • The upgrade-guide entry from the original commit is omitted: the options are purely additive on this branch, and the guide is for migration concerns.
  • Generated configurers and metadata were regenerated from source rather than taken from the cherry-pick.
  • Module suite green (16 tests, including the 6 added by this change).

Claude Code on behalf of oscerd

@oscerd
oscerd requested review from davsclaus and gnodet July 28, 2026 12:12
Backport of 010bcd5 to camel-4.14.x.

Adds jwtIssuer and jwtAudience to the embedded HTTP server and the management
server. When either is set, a JWTOptions configured with the corresponding values
is attached to the JWTAuthOptions passed to JWTAuth.create, so the iss and aud
claims are validated in addition to the signature and expiry.

jwtAudience accepts a comma-separated list; a token is accepted if its aud claim
matches any configured value.

Behaviour is unchanged when both are unset, so this is additive: existing
configurations continue to build the authenticator exactly as before.

The upgrade-guide entry from the original commit is omitted, since the options are
purely additive on this branch and the guide is for migration concerns.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Andrea Cosentino <ancosen@gmail.com>
@oscerd
oscerd force-pushed the backport/CAMEL-23525-4.14.x branch from fc64ab1 to 13200da Compare July 28, 2026 12:25
The committed catalog copy of camel-main-configuration-metadata.json carried
main-only entries not present on camel-4.14.x (camel.security /
SecurityConfigurationProperties, errorRegistryEnabled/errorRegistryMaximumEntries,
the security="insecure:dev" attribute, and json/png route-dump options), picked
up from a main-built camel-main artifact during an earlier regeneration.
Regenerate the catalog copy from this branch's camel-main so it matches the
module's generated metadata, which is what CI reproduces — fixing the
"uncommitted changes" failure. The CAMEL-23525 jwtIssuer/jwtAudience options remain.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Andrea Cosentino <ancosen@gmail.com>
@oscerd oscerd added the enhancement New feature or request label Jul 29, 2026
@oscerd oscerd self-assigned this Jul 29, 2026
@oscerd oscerd added this to the 4.14.9 milestone Jul 29, 2026
@oscerd
oscerd merged commit a69ff2b into apache:camel-4.14.x Jul 29, 2026
3 checks passed
@oscerd
oscerd deleted the backport/CAMEL-23525-4.14.x branch July 29, 2026 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants