Repository navigation
Description
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
scim
Bug Description
A SCIM PATCH that removes group members by listing them in the operation's value, with no filter in the path, returns 200 and removes nobody:
{
"schemas": ["urn:ietf:params:scim:api:messages:2.0:PatchOp"],
"Operations": [
{ "op": "remove", "path": "members", "value": [ { "value": "<user id>" } ] }
]
}This is the form Microsoft Entra ID uses to remove a member from a provisioned group. Because the server reports success, Entra records the member as removed while the user stays in the Keycloak group. Nothing in Keycloak's logs or in the response shows that the request was ignored.
RFC 7644 section 3.5.2.2 defines remove with a path and, for multi-valued attributes, the filter form. Answering 200 while ignoring the value is the problem here; either honouring the value or refusing the request with 400 would be safe.
Version
main (f2326fc, 18 November 2026). Also reproduced on a29205c (14 November).
Regression
- The issue is a regression
Expected behavior
The members listed in value are removed. A listed user who is not a member is ignored, as with the filter form. An unknown user id fails the whole request with 400 and removes nobody.
Actual behavior
200 OK, and every listed member is still in the group.
If the group also holds a service account, the request is refused instead, so a person cannot be removed from such a group this way at all.
How to Reproduce?
- Enable SCIM on a realm and create a group with two members through SCIM.
- Send the PATCH above with one member's id.
- GET the group with
attributes=members: both members are still present.
Anything else?
Searched existing issues for "SCIM", "remove", "members", "value", "PATCH" and "Entra" on 18 November 2026. No issue covers removing by value.
Related issues, each a different case:
- SCIM PATCH "replace" on unfiltered members/groups path never removes stale entries #52752: an unfiltered
replaceonmembersremoves nobody. It starts at the same place,Path.getValue, which yields no value for a path without a filter. The operation is different, though. A contributor offered a fix there on 1 November, and this fix touches the same code, so the two should be reviewed together. I'm happy to rebase onto theirs or fold this case into it, whichever a maintainer prefers. - SCIM: PUT on a group with "members": [] returns 200 but removes nobody #54530: the PUT form of the same silent no-op, which I reported and which is now fixed.
- A comment on SCIM PATCH "replace" on unfiltered members/groups path never removes stale entries #52752 from 2 November covers
removewith no filter and no value. That is a third case. This issue covers only the value-list form.
A fix is ready with tests (remove by value; a member entry without a value gives 400; a filter and a value together give 400; service accounts stay protected). I can open a pull request if a maintainer agrees with the approach. This text and the pull request were prepared with the help of an AI coding assistant, as CONTRIBUTING.md asks contributors to disclose.
Metadata
Metadata
Assignees
Labels
Type
Fields
Projects
- StatusShow more project fieldsOpen
Activity
Remove the SCIM group members or user groups listed in a PATCH remove…
Remove the SCIM group members or user groups listed in a PATCH remove…
Remove the SCIM group members or user groups listed in a PATCH remove…
Remove the SCIM group members or user groups listed in a PATCH remove…
Remove the SCIM group members or user groups listed in a PATCH remove…