Skip to content

It is not possible to set/update service account user custom attribute. #1323

@jhomola79

Description

@jhomola79

Current Behavior

When with this:
"users": [ { "username": "service-account-someClientId", ... "attributes": { "someCustomAttributeId": [ "someCustomAttributeIdValue" ] } } ]

service account attribute is not set. Only when it works, is when there is already some(/different) attribute already set(manually?).

From my perspective it is caused by commit 5c31615, when IGNORED_PROPERTIES_FOR_UPDATE was extended with "attributes". Without "attributes" there, it works for my case, but I can't track the reason of that change for eventual pull request.

public class UserImportService {
private static final String[] IGNORED_PROPERTIES_FOR_UPDATE = {"realmRoles", "clientRoles", "serviceAccountClientId", "attributes"};

Expected Behavior

No response

Steps To Reproduce

Environment

  • Keycloak Version: 26.3.3
  • keycloak-config-cli Version: 6.4
  • Java Version: 21

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions