#50505·keycloak

User Profile attribute default value not persisted on user creation, missing in jwt user attribute

Author: Cyclone5Created Jul 1, 2026Updated Sep 30, 2026
Labelskind/bugpriority/importantarea/user-profileteam/core-iam

Before reporting an issue

  • I have read and understood the above terms for submitting issues, and I understand that my issue may be closed without action if I do not follow them.

Area

user-profile

Describe the bug

When a User Profile attribute has a default value configured, the default value is not written to the user_attribute table when a new user is created. As a result, the claim is missing from the JWT even though the client scope and protocol mapper are configured correctly. Only after saving the user via the Admin Console does the row get created in user_attribute and the claim appear in the JWT.

Version

26.6.4

Regression

  • The issue is a regression

Expected behavior

The configured default value should appear in the jwt.

Actual behavior

On user creation, the default value is not applied automatically, so the claim is absent from the JWT.

How to Reproduce?

  1. Realm Settings → User Profile: add an attribute with a defaultValue, e.g. { "name": "profile_image", "defaultValue": "https://example.com/default.png" }
  2. Add a User Attribute protocol mapper for it to a client scope, mapped into the token
  3. Create a new user
  4. SELECT * FROM user_attribute WHERE user_id = 'XXX'; → no row
  5. Get an access token for the user → claim is missing
  6. Open the user in the Admin Console and just click Save (the profile image default value is visible here).
  7. Repeat steps 4–5 → row now exists and claim is present in the JWT

Anything else?

No response