8000 Reset phoneNumberVerified when users change their phone number by ryan-morris · Pull Request #53020 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

Reset phoneNumberVerified when users change their phone number - #53020

Open
ryan-morris wants to merge 4 commits into
keycloak:mainfrom
ryan-morris:phone/1-verified-reset
Open

ryan-morris wants to merge 4 commits into
keycloak:mainfrom
ryan-morris:phone/1-verified-reset

Conversation

@ryan-morris
Copy link
Copy Markdown
Contributor

Closes #53019

The main draw back of this approach is that the phoneNumberVerified will 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 involve libphonenumber and 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.

Copilot AI balanced review requested due to automatic review settings September 21, 2026 14:20
@ryan-morris
ryan-morris requested a review from a team as a code owner September 21, 2026 14:20
Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 Medium severity

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.

Copilot AI review requested due to automatic review settings September 21, 2026 14:57
Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The implementation matches the stated requirements and includes comprehensive coverage for affected flows and exclusions.

Review effort: Balanced
Findings: None

Resolved since last review (1)

Copilot AI balanced review requested due to automatic review settings September 29, 2026 17:36
Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The implementation matches the stated requirements and includes comprehensive coverage of affected update paths.

Review effort: Balanced
Findings: None

Copilot AI balanced review requested due to automatic review settings October 26, 2026 17:05
Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Pending phone removals can produce incorrect audit history, and the new broker tests need runtime provider URLs to work with TLS.

2 open issues

Review effort: Balanced

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
ryan-morris force-pushed the phone/1-verified-reset branch from 596bd8a to 74d0534 Compare October 26, 2026 22:05
Copilot AI balanced review requested due to automatic review settings October 26, 2026 22:05
Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reset phoneNumberVerified when user changes phone number

2 participants

0