Thanks to visit codestin.com
Credit goes to github.com

Skip to content

PatchOp from EntraId for EnterpriseUser Extensions throws exceptions #77

@Caleb1424

Description

@Caleb1424

When EntraID sends the following Patch Request:

{
    "schemas": [
        "urn:ietf:params:scim:api:messages:2.0:PatchOp"
    ],
    "Operations": [
        {
            "op": "Replace",
            "path": "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:organization",
            "value": "COMPANY1"
        }
    ]
}

the result is:

{
    "schemas": [
        "urn:ietf:params:scim:api:messages:2.0:Error"
    ],
    "status": "400",
    "scimType": "invalidPath",
    "detail": "Invalid attribute path 'urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:organization' in supplied value for 'replace' op of operation 2 in PatchOp request body"
}

Expected Behavior

The Patch-Request should replace the organization property without exception.

Actual Behavior

On internal debugging of the #replace Function in scimmy I see that first the property "organization" is removed then added. The removal of the property is successfull. The target has no longer an "organization"-Property.
It assigns a "undefined" to it.

Within the #add Function it throws an exception while assign the new value:
"Cannot add property organization, object is not extensible"

This is the line where the Exception is thrown:
return (this[extension.id] = Object.assign(this[extension.id] ?? {}, data));

Steps To Reproduce

Send a PATCH - Request to scimmy with an registered urn:ietf:params:scim:schemas:extension:enterprise:2.0:User
for an already existing user with an organization.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions