I'm working on updating my application's SCIM endpoints to support Microsoft Entra ID, and I just noticed some strange behavior when a User is being updated, which seems specific to multi-value attributes.
In my Entra ID testing environment, I've set up the User Attribute Mappings to include a custom attribute, and checked the box for Multi-Value?: urn:ietf:params:scim:schemas:extension:greenhouse:2.0:User:department_ids, and am setting the value via an Expression on the User's department field: Split([department], ","). The odd behavior I'm experiencing is this - when I provision a User, and then update the department field on the Entra ID User, and re-provision them, I can see that the PATCH request being sent includes an Add Operation, rather than a Replace, which is what I would have expected. The body of the request looks like this:
{
"schemas" => ["urn:ietf:params:scim:api:messages:2.0:PatchOp"],
"Operations" => [
{
"op" => "Add",
"path" => "
urn:ietf:params:scim:schemas:extension:greenhouse:2.0:User:department_ids
",
"value" => [{ "value" => "1"}]
}
}
This is causing unexpected behavior, because from the perspective of someone trying to update a User in Entra ID, when they clear out and update the value of the User's department field, it should overwrite any existing value, i.e. trigger a Replace Operation. But instead since this is triggers an Add Operation, the end result is this: when a User in our application already has a value set for this department_ids, we will append that value to the existing value, and so the Entra ID User and the User in our application are out of sync.
How can I change things to trigger a Replace Operation in this case, rather than an Add? Am I mis-configuring this custom multi-value attributes? I have seen some confusing information in the Entra ID docs about custom mult-value attributes not being fully supported. For example from this documentation page:
Custom attributes can't be referential attributes, multi-value, or complex-typed attributes. Custom multi-value and complex-typed extension attributes are currently supported only for applications in the gallery.
Our application is in the Gallery, but is not yet approved for use with SCIM: does this mean this behavior with multi-value custom attributes will change once the application is approved for SCIM?
Finally, I also found two other similar questions (1 and 2), but the answer for 1 didn't apply in my case, and answer for the second was not particularly helpful.