Repository navigation
Reset phoneNumberVerified when users change their phone number - #53020
Open
ryan-morris wants to merge 4 commits into
Open
ryan-morris wants to merge 4 commits into
ryan-morris wants to merge 4 commits into
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Removing both unmanaged phone attributes deletes the verification flag instead of resetting it to false.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Resets stale phone verification when users change their own phone number.
Changes:
- Adds context-aware reset logic and auditing.
- Adds account, required-action, and IdP review tests.
- Documents the new behavior.
| File | Description |
|---|---|
server-spi/.../UserProfileContext.java |
Configures reset behavior by context. |
server-spi-private/.../DefaultUserProfile.java |
Implements verification reset logic. |
tests/base/.../AccountRestServiceTest.java |
Tests account REST updates. |
tests/base/.../RequiredActionUpdateProfileTest.java |
Tests required-action updates. |
tests/base/.../IdpReviewProfileAuthenticatorTest.java |
Tests IdP review updates. |
docs/.../changes-26_8_0.adoc |
Adds upgrade guidance. |
docs/.../con-client-scopes.adoc |
Documents phone-scope behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Closes keycloak#53019 Signed-off-by: ryan-morris <ryan@devenvy.com>
When an update removes both phoneNumber and phoneNumberVerified, the flag is reset to false rather than removed. Signed-off-by: ryan-morris <ryan@devenvy.com>
Signed-off-by: ryan-morris <ryan@devenvy.com>
… removed With unmanaged attributes enabled, an update that omits phoneNumber but submits phoneNumberVerified first wrote the submitted flag and then reset it, so the UPDATE_PROFILE event reported a verification change that never happened. The broker tests now take the provider endpoints from the provider realm's base URL, so they also run when the server uses TLS. Signed-off-by: ryan-morris <ryan@devenvy.com>
ryan-morris
force-pushed
the
phone/1-verified-reset
branch
from
October 26, 2026 22:05
596bd8a to
74d0534
Compare
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
Static review identified no unresolved blocking issues, and regression coverage addresses the intended self-service behavior and previously reported removal case.
No open issues 🎉
2 resolved since last review
Review effort: Balanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending review
2E6E
s.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Closes #53019
The main draw back of this approach is that the
phoneNumberVerifiedwill be set to false even if a user only changes the formatting of the phone number (i.e parentheses, spaces or dashes) and not the phone number itself). I can revise to try and extract just the phone number, but reliable mechanisms usually involvelibphonenumberand I didn't want to drag in that dependency without maintainer input. I could add a simpler approach of removing symbols to compare just the digits.I used Claude and Codex to help with this PR. Codex strictly as a review agent.