Repository navigation
fix(broker): Allows cross session email validation (#52604) - #52626
Conversation
60576f4 to
2b74f81
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The new cross-session path needs a dedicated regression test.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Enables cross-session email verification for detect-existing-user broker flows.
Changes:
- Consumes the verified-user marker.
- Restores the user and verification state before continuing account linking.
File summaries
| File | Description |
|---|---|
IdpDetectExistingBrokerUserAuthenticator.java |
Handles cross-session verification for existing broker users. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| runIfUserVerified(context.getSession(), user, broker, brokerContext.getBrokerUserId(), | ||
| () -> { | ||
| context.setUser(user); | ||
| context.getAuthenticationSession().setAuthNote( | ||
| IdpEmailVerificationAuthenticator.VERIFY_ACCOUNT_IDP_USERNAME, | ||
| brokerContext.getUsername() | ||
| ); | ||
| }); |
2b74f81 to
c6ddf4a
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The test places email verification after auto-linking, so it does not reproduce the reported flow ordering.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Balanced
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.BruteForceTest#testCacheExpiryForTemporaryLockout |
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.BruteForceTest#testCacheExpiryForTemporaryLockoutKeycloak CI - Forms IT (chrome) |
|
Hi @olivierboudet. The fix looks ok to me. Can you please rebase the PR on main? Please keep in mind that in the meantime, the KcOidcFirstBrokerLoginDetectExistingUserTest was migrated from the legacy test suite to the new one in #52787. This might mean re-writing the test. Refer to the test framework documentation, or ask away if you need any help. |
Allows cross session email validation when using IdpDetectExistingBrokerUserAuthentication instead of IdpCreateUserIfUniqueAuthenticator Signed-off-by: Olivier Boudet <o.boudet@gmail.com>
c8bd7ea to
06079c6
Compare
|
hi @vaceksimon thank you, I have rebased the branch and fix updated the test 👍 |
vaceksimon
left a comment
There was a problem hiding this comment.
LGTM, thank you @olivierboudet
msdaly200
left a comment
There was a problem hiding this comment.
Just one comment about priorities of the steps being set for the test.
Signed-off-by: Olivier Boudet <o.boudet@gmail.com>
375909e to
467756b
Compare
rmartinc
left a comment
There was a problem hiding this comment.
Thanks @olivierboudet, @vaceksimon and @msdaly200! LGTM too!
…eycloak#52626) * fix(broker): Allows cross session email validation (keycloak#52604) Allows cross session email validation when using IdpDetectExistingBrokerUserAuthentication instead of IdpCreateUserIfUniqueAuthenticator Signed-off-by: Olivier Boudet <o.boudet@gmail.com> * fix priority Signed-off-by: Olivier Boudet <o.boudet@gmail.com> --------- Signed-off-by: Olivier Boudet <o.boudet@gmail.com>
…eycloak#52626) * fix(broker): Allows cross session email validation (keycloak#52604) Allows cross session email validation when using IdpDetectExistingBrokerUserAuthentication instead of IdpCreateUserIfUniqueAuthenticator Signed-off-by: Olivier Boudet <o.boudet@gmail.com> * fix priority Signed-off-by: Olivier Boudet <o.boudet@gmail.com> --------- Signed-off-by: Olivier Boudet <o.boudet@gmail.com>
Fixes #52604
Allows cross session email validation when using IdpDetectExistingBrokerUserAuthentication instead of IdpCreateUserIfUniqueAuthenticator