Repository navigation
Replies: 1 comment
|
Thanks for the detailed writeup, @Prasad484, and for laying out the ownership model this clearly. Before we go further on the implementation, flagging how this overlaps with what's already in flight so we don't duplicate effort (and for my own sanity I need to organize things a little differently): #53130 (accept members on POST) is what @pedroigor and @atiqur-rahman-pro agreed on in September, before the Okta captures you and @wparr-circle added in November showed that PUT-only clients can't be unblocked by a POST-only fix. That agreement predates this proposal and shouldn't be read as sign-off on accepting members on PUT. #54530 went the other way very recently: #54535 (merged, closed by @pedroigor on Nov 6) made PUT reject an empty members list too, tightening the #46216 restriction rather than loosening it. #52752 is a separate bug (PATCH replace not removing stale entries) with its own fix in progress; it doesn't depend on ownership. #55341 and #55342 came out the same day as this discussion. #55342 still implements the earlier per-client "claims" model, not the exclusive-owner model described here, and review already surfaced real gaps in it (ownership lost on export/import, federated-storage members untracked, a couple of lock-ordering and perf issues). Rather than keep hardening an implementation of a design that's being replaced, I'd pause #55342 until the questions below are settled, then rework it in one pass. On the open questions: I don't see @pedroigor's input anywhere in this cluster yet. His last word on PUT was the comment on #53130, which was about POST, not PUT, and predates this proposal. @pedroigor, given the new field data from two independent Okta integrations, can you weigh in on the four questions above, in particular whether exclusive per-client ownership is acceptable in core as an experimental feature? That's the decision blocking everything else here. Once we have that: keep this discussion as the design record, make #55341 the single tracking issue for the PUT/ownership piece (re-scoping #53130 to POST-only, since POST-with-members outside ownership mode is still a legitimate smaller ask on its own), and rework #55342 to the exclusive-owner model rather than iterating further on the current shape. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Today a SCIM
PUT /Groups/{id}that carriesmembersis refused, by design (#46216), and #53130 plans to accept members onPOSTwhile keepingPUTrestricted. I'd like to propose a way to acceptPUTsafely, and ask whether it fits.The problem
Okta applications built with the App Integration Wizard push groups only with
PUT, sending the full member list each time, and the integration cannot be switched toPATCH. As captured on #53130 (by me with a wizard app, and by @wparr-circle with the Okta Provisioning Agent), only an empty group can reach Keycloak today. Every later add gets a 400 and Okta puts the group in an error state, and removing the last member gets a 200 that changes nothing (#54530).Accepting
PUTwith plain replace semantics would fix Okta and cause a new problem. A replace removes everyone the caller did not list. That includes members an administrator added in Keycloak, and members another SCIM client added to the same group. I assume this is part of whyPUTwas restricted.The proposal
The SCIM client that creates a group owns it, and only that client changes the group's members. The client is the one the access token was issued to. The membership is what the owner last sent.
For example, Okta creates Finance with Alice and Bob, so Okta owns Finance. Okta then sends a
PUTlisting only Alice, and Bob leaves the group. Another SCIM client that tries to add to, remove from, replace or delete Finance gets a 403.This matches how Okta describes group push itself: once a group is pushed, Okta becomes the group source.
The rules:
POST /Groupswithmemberscreates the group with those members, and the calling client becomes its owner.PUTa full member list (members not listed leave),PATCHadd,removeandreplace, including Entra'sremovewith avaluelist (Remove the SCIM group members or user groups listed in a PATCH remove value #55310), andDELETE. Any other SCIM client gets a 403 for all of them, including a delete of a group that has an owned group below it.groupson/Userscannot add or remove a membership of an owned group (400,mutability), as RFC 7643 section 4.1.2 describes, so an owned group has one write path.Storage is one new table,
SCIM_GROUP_OWNER(group, client ID), removed with its group.It is off by default behind two switches: an experimental feature
scim-group-membership-claims, which requiresscim-api, and a realm attributescimGroupMembershipClaims. With either one off, the SCIM endpoints behave exactly as they do today.Administrators and mappers
An owner's full
PUTremoves members that an administrator added. I'd like to follow the pattern Keycloak uses for organization groups and refuse membership changes to owned groups through the Admin REST API, in a separate PR. Identity provider and LDAP group mappers that would change an owned group would skip that change and log a warning, also in a separate PR. Until those land, the documentation states that the owner's next fullPUToverwrites an administrator's change.What exists
#55342 implements an earlier version of this proposal, which recorded which SCIM client added each member so that several clients and administrators could share one group. It was tested against a real Okta wizard app. Review found most of its problems in that per-client bookkeeping, and sharing one group between several directories looks uncommon, so I'd rework #55342 to the model above if it fits.
Questions for maintainers
PUTrestricted and leave this to extensions?Related: #46216, #53130, #54530, #52752, #55310, #55341, #55342.
AI assistance: the implementation and this write-up were prepared with Claude Code, an AI coding agent. I have reviewed them and will handle the discussion and review.
All reactions