8000 Replace a credential only if unchanged when re-hashing a password by ahus1 · Pull Request #55053 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

Replace a credential only if unchanged when re-hashing a password - #55053

Merged
ahus1 merged 1 commit into
keycloak:release/26.6from
ahus1:is-55028-backport-26.6
Nov 12, 2026
Merged

ahus1 merged 1 commit into
keycloak:release/26.6from
ahus1:is-55028-backport-26.6

Conversation

@ahus1
@ahus1 ahus1 commented Nov 11, 2026
Copy link
Copy Markdown
Member

Add updateStoredCredential(oldCred, newCred) that replaces a stored credential only if it still has the content of the old version, using a pessimistic lock in the JPA stores. Use it in the deferred password re-hash, so that it no longer overwrites a credential that changed after it was validated.

Closes #55028

(cherry picked from commit e4bcd40)

Add updateStoredCredential(oldCred, newCred) that replaces a stored credential only if it still has the content of the old version, using a pessimistic lock in the JPA stores. Use it in the deferred password re-hash, so that it no longer overwrites a credential that changed after it was validated.

Closes keycloak#55028

(cherry picked from commit e4bcd40)

Signed-off-by: Alexander Schwartz <alexander.schwartz@ibm.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@keycloak-github-bot keycloak-github-bot Bot left a comment
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unreported flaky test detected, please review

@keycloak-github-bot
Copy link
Copy Markdown

Unreported flaky test detected

If 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.broker.KcSamlBrokerArtifactBindingTest#testLoginWithSignatureAtAssertionLevelErrorInvalidSignature

Keycloak CI - Base IT (2)

org.junit.ComparisonFailure: expected:<[Invalid signature in response from identity provider.]> but was:<[An internal server error has occurred]>
	at org.junit.Assert.assertEquals(Assert.java:117)
	at org.junit.Assert.assertEquals(Assert.java:146)
	at org.keycloak.testsuite.broker.KcSamlBrokerArtifactBindingTest.login(KcSamlBrokerArtifactBindingTest.java:169)
	at org.keycloak.testsuite.broker.KcSamlBrokerArtifactBindingTest.performTest(KcSamlBrokerArtifactBindingTest.java:153)
...

Report flaky test

@keycloak-github-bot keycloak-github-bot Bot left a comment
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unreported flaky test detected, please review

@keycloak-github-bot
Copy link
Copy Markdown

Unreported flaky test detected

If 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.broker.KcSamlBrokerArtifactBindingTest#testLoginWithSignatureAtAssertionLevelErrorInvalidSignature

Keycloak CI - Base IT (2)

org.junit.ComparisonFailure: expected:<[Invalid signature in response from identity provider.]> but was:<[An internal server error has occurred]>
	at org.junit.Assert.assertEquals(Assert.java:117)
	at org.junit.Assert.assertEquals(Assert.java:146)
	at org.keycloak.testsuite.broker.KcSamlBrokerArtifactBindingTest.login(KcSamlBrokerArtifactBindingTest.java:169)
	at org.keycloak.testsuite.broker.KcSamlBrokerArtifactBindingTest.performTest(KcSamlBrokerArtifactBindingTest.java:153)
...

Report flaky test

@ahus1
ahus1 marked this pull request as ready for review November 12, 2026 09:58
@ahus1
ahus1 requested review from a team as code owners November 12, 2026 09:58
@ahus1
ahus1 enabled auto-merge (squash) November 12, 2026 09:58
@mabartos mabartos linked an issue Nov 12, 2026 that may be closed by this pull request
2 tasks done
@mabartos mabartos left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ahus1
ahus1 merged commit 8173b8a into keycloak:release/26.6 Nov 12, 2026
138 of 141 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deferred password re-hash overwrites a credential that changed after it was validated

3 participants

0