keycloak/keycloak

OrganizationProvider.addManagedMember still adds member as unmanaged

Open

#43,094 建立於 2025年9月30日

在 GitHub 查看
 (3 留言) (3 反應) (0 負責人)Java (8,346 fork)batch import
area/organizationshelp wantedkind/bugpriority/normalstatus/auto-bumpteam/core-iam

倉庫指標

Star
 (34,398 star)
PR 合併指標
 (平均合併 6天 19小時) (30 天內合併 384 個 PR)

描述

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

core

Describe the bug

When using OrganizationProvider.addManagedMember to add a user to an organization as a managed member, the user is still marked as unmanaged.

Going through the source code, I notice there is a default method in UserModel that drops the MembershipMetadata parameter.

    default void joinGroup(GroupModel group, MembershipMetadata metadata) {
        joinGroup(group);
    }

And the eventual joinGroup implementation is then using unmanaged as default.

Version

26.4.0

Regression

  • The issue is a regression

Expected behavior

When calling the OrganizationProvider.addManagedMember method, the user should be added as a managed member to the organization.

Actual behavior

When calling the OrganizationProvider.addManagedMember method, the user is added as an unmanaged member to the organization.

How to Reproduce?

Create a AdminRealmResourceProvider with a resource path that calls this method.

Anything else?

No response

貢獻者指南