Ravi
Ravi

Reputation: 124

PATCH request for SCIM 2.0

We are sending PATCH request to a server in SCIM specification.

As per the SCIM specifications, the request should contain following attributes in PATCH request.

So if we are changing the 'givenName' attribute from core schema then the PATCH request will be in following way, (ref: https://www.rfc-editor.org/rfc/rfc7644#section-3.5.2)

{
 "schemas" : ["urn:ietf:params:scim:api:messages:2.0:PatchOp"],
     "Operations":[
       {
        "op":"replace",
        "path":"name.givenName",
        "value":"Ravindra"
       }
     ]
}

Now what should be the 'path' attribute if are modifying any SCIM extension, let's say enterprise extension.

Is the following representation is correct for enterprise extension?

{
 "schemas" : ["urn:ietf:params:scim:api:messages:2.0:PatchOp"],
     "Operations":[
       {
        "op":"replace",
        "path":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:user.department",
        "value":"Engineering"
       }
     ]
}

Upvotes: 5

Views: 6594

Answers (3)

Ranjith Manickam
Ranjith Manickam

Reputation: 211

Attribute '.Operations.[].value' must be of type hash

{
  "schemas": [
    "urn:ietf:params:scim:schemas:core:2.0:User"
  ],
  "Operations": [
    {
      "op": "replace",
      "value": {
        "active": false
      }
    }
  ]
}

Hope this will work!!

Upvotes: 0

Jose
Jose

Reputation: 36

As in the ABNF to which scim filters should adhere (see section 3.4.2.2 of RFC 7644), when you refer to an attribute part of an extension you should do URI:attribute_path, so in your case this is "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:department"

Upvotes: 2

bmontalvo
bmontalvo

Reputation: 19

I was getting a similar error when attempting to PATCH the "active" value of an enterprise user. The solution is simple: change your "path" value in the example above to simply "department".

For completeness, here's the PATCH body that worked for me in Postman:

{
  "schemas": [
    "urn:ietf:params:scim:api:messages:2.0:PatchOp"
  ],
  "Operations": [
     {
       "op":"replace",
       "path":"active",
       "value":"false"
     }
  ]
}

Upvotes: 0

Related Questions