Rotated client secret remains valid when the feature is disabled - #50910
Conversation
mabartos
commented
Jul 15, 2026
- Closes Rotated client secret remains valid when the feature is disabled #50855
Unreported flaky test detectedIf the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR. org.keycloak.testsuite.oauth.ClientAuthPostMethodTest#testPostAuthenticationNotAllowedWhenBasicRequestedorg.keycloak.testsuite.oauth.ClientAuthPostMethodTest#testBasicAuthenticationNotAllowedWhenPostRequested |
Unreported flaky test detectedIf the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR. org.keycloak.testsuite.oauth.ClientAuthPostMethodTest#testPostAuthenticationNotAllowedWhenBasicRequestedorg.keycloak.testsuite.oauth.ClientAuthPostMethodTest#testBasicAuthenticationNotAllowedWhenPostRequested |
There was a problem hiding this comment.
Pull request overview
Prevents rotated client secrets from authenticating when client-secret rotation is disabled.
Changes:
- Gates rotated-secret detection on the feature flag while preserving cleanup.
- Adds disabled-feature regression coverage.
- Updates existing rotation tests for raw attribute checks.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
testsuite/.../ClientSecretRotationTest.java |
Checks persisted rotation attributes directly. |
tests/.../ClientSecretRotationDisabledTest.java |
Tests rejection of stale rotated secrets. |
services/.../ClientResource.java |
Documents cleanup behavior. |
services/.../OIDCClientSecretConfigWrapper.java |
Applies feature gating and feature-independent cleanup. |
rmartinc
left a comment
There was a problem hiding this comment.
Thanks @mabartos! The change is OK to me. Just a little comment for the test class, the test side now needs the profile configured with the proper feature enabled. With the Profile configured I suppose the class should work with no more modifications.
Closes keycloak#50855 Signed-off-by: Martin Bartoš <mabartos@redhat.com>
Co-authored-by: Ricardo Martin <rmartinc@redhat.com> Signed-off-by: Martin Bartoš <mabartos@redhat.com>
Unreported flaky test detectedIf the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR. org.keycloak.testsuite.forms.MultipleTabsLoginTest#multipleTabsParallelLoginTestWithAuthSessionExpiredAndRegisterClickKeycloak CI - Forms IT (chrome) org.keycloak.testsuite.oauth.ClientAuthPostMethodTest#testPostAuthenticationNotAllowedWhenBasicRequestedorg.keycloak.testsuite.oauth.ClientAuthPostMethodTest#testBasicAuthenticationNotAllowedWhenPostRequestedorg.keycloak.testsuite.forms.MultipleTabsLoginTest#testEmptyBaseUrlKeycloak CI - Forms IT (firefox) org.keycloak.testsuite.forms.MultipleTabsLoginTest#multipleTabsParallelLoginTestWithAuthSessionExpiredAndRegisterClickKeycloak CI - Forms IT (firefox) org.keycloak.testsuite.forms.BrowserFlowTest#testUserWithOneAdditionalFactorOtpSuccess |
|
@rmartinc Fixed. Ready for another review. Thanks! |