After "Repair sign-in" on staging (tenant sharna), the invite link failed in a private window with "invalid email address". The Keycloak user had email: null, no first or last name.
Cause
Keycloak 26 checks a user PUT against the declarative user profile and clears email, firstName, lastName when the body omits them. The registry wrote attributes with a body of only {attributes}. SyncTenantStatus runs after every status change and right after the reprovision invite, so it removed the address the mail had just been sent to. The VERIFY_EMAIL action then had no email to verify.
Staging has two users hit by this: the sharna admin and stage-demo-1156, which had a status change earlier.
Fix
New updateUserAttributes reads the full user representation, changes only attributes, and writes the whole representation back. SyncTenantStatus, ensureUserAttributes and SyncClaims use it.
Tests
A regression test: after all three writes, username, email, names, enabled, requiredActions and the other attributes are still there.
## Bug
After \"Repair sign-in\" on staging (tenant `sharna`), the invite link failed in a private window with **\"invalid email address\"**. The Keycloak user had `email: null`, no first or last name.
## Cause
Keycloak 26 checks a user `PUT` against the declarative user profile and **clears `email`, `firstName`, `lastName` when the body omits them**. The registry wrote attributes with a body of only `{attributes}`. `SyncTenantStatus` runs after every status change and right after the reprovision invite, so it removed the address the mail had just been sent to. The `VERIFY_EMAIL` action then had no email to verify.
Staging has two users hit by this: the sharna admin and `stage-demo-1156`, which had a status change earlier.
## Fix
New `updateUserAttributes` reads the full user representation, changes only `attributes`, and writes the whole representation back. `SyncTenantStatus`, `ensureUserAttributes` and `SyncClaims` use it.
## Tests
- A regression test: after all three writes, username, email, names, enabled, requiredActions and the other attributes are still there.
- If nothing changed, nothing is written.
- A failing GET is reported.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
Keycloak 26 validates a user PUT against the declarative user profile and
clears email, firstName and lastName when the body leaves them out. The
registry wrote attributes with a body of only {attributes}, so every status
sync wiped the members' email addresses. Reprovision syncs the status right
after the invitation goes out; the action link then failed with "invalid
email address".
Attribute writes now read the full user, change the attributes in it and
write the whole representation back (SyncTenantStatus, ensureUserAttributes,
SyncClaims).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
sharang
merged commit 485f3432ac into main2026-09-28 07:44:46 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Bug
After "Repair sign-in" on staging (tenant
sharna), the invite link failed in a private window with "invalid email address". The Keycloak user hademail: null, no first or last name.Cause
Keycloak 26 checks a user
PUTagainst the declarative user profile and clearsemail,firstName,lastNamewhen the body omits them. The registry wrote attributes with a body of only{attributes}.SyncTenantStatusruns after every status change and right after the reprovision invite, so it removed the address the mail had just been sent to. TheVERIFY_EMAILaction then had no email to verify.Staging has two users hit by this: the sharna admin and
stage-demo-1156, which had a status change earlier.Fix
New
updateUserAttributesreads the full user representation, changes onlyattributes, and writes the whole representation back.SyncTenantStatus,ensureUserAttributesandSyncClaimsuse it.Tests
🤖 Generated with Claude Code
https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
Keycloak 26 validates a user PUT against the declarative user profile and clears email, firstName and lastName when the body leaves them out. The registry wrote attributes with a body of only {attributes}, so every status sync wiped the members' email addresses. Reprovision syncs the status right after the invitation goes out; the action link then failed with "invalid email address". Attribute writes now read the full user, change the attributes in it and write the whole representation back (SyncTenantStatus, ensureUserAttributes, SyncClaims). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB