oscerd opened a new pull request, #23197: URL: https://github.com/apache/camel/pull/23197
## Summary `KeycloakSecurityHelper.parseAndVerifyAccessToken` built its `TokenVerifier` with only `SUBJECT_EXISTS_CHECK` and a `RealmUrlCheck`. Keycloak's `TokenVerifier` starts with an empty internal check list and `withChecks(...)` appends rather than replacing a default set, so the built-in `IS_ACTIVE` predicate (which validates the `exp` and `nbf` claims) was not part of the verification chain. This PR adds `TokenVerifier.IS_ACTIVE` to the `withChecks(...)` invocation so the helper enforces the token's validity window in addition to signature, subject, and issuer. Tracking issue: https://issues.apache.org/jira/browse/CAMEL-23504 ## Changes - `KeycloakSecurityHelper.java`: include `TokenVerifier.IS_ACTIVE` in the `.withChecks(...)` call. - `KeycloakSecurityHelperTest.java`: two new tests - `testParseAndVerifyAccessTokenRejectsExpiredToken` — signs a token whose `exp` claim is one hour in the past with an RSA key and asserts that `parseAndVerifyAccessToken` throws `VerificationException`. - `testParseAndVerifyAccessTokenAcceptsValidToken` — signs an unexpired token and asserts verification returns the parsed claims (happy-path regression test). ## Test plan - [x] `mvn install` in `components/camel-keycloak` — 16/16 tests pass - [x] `mvn clean install -DskipTests -Dquickly` from repo root — BUILD SUCCESS --- _Claude Code on behalf of Andrea Cosentino_ -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
