SCIMReferenceCode icon indicating copy to clipboard operation
SCIMReferenceCode copied to clipboard

Non-compliant PATCH calls

Open plamenGo opened this issue 5 years ago • 1 comments

Your test suite tries to PATCH a group with the following call:

PATCH http://{{Server}}{{Port}}/{{Api}}/Groups/{{groupid}}


{
    "schemas": [
        "urn:ietf:params:scim:api:messages:2.0:PatchOp"
    ],
    "Operations": [
        {
            "name": "addMember",
            "op": "add",
            "path": "members",
            "value": [
            	{
            		"displayName":"new User",
            		"value":"{{id4}}"	
            	}
            	]
            
        }
    ]
}

However, it seems that 'displayName' should be 'display' as per https://tools.ietf.org/html/rfc7644.

This causes my endpoint to seemingly correctly output:

{
    "schemas": [
        "urn:ietf:params:scim:api:messages:2.0:Error"
    ],
    "status": 400,
    "scimType": "invalidPath",
    "detail": "invalidPath: no attribute named 'displayName' from 'members'"
}

Which in turn causes a subsequent test to fail as the user is not a member of that group.

Can you confirm this is an error, and should I open a pull request to fix?

Thanks!

plamenGo avatar May 01 '20 18:05 plamenGo

I can confirm this. There also seem to be a whole host of problems with the implementation.

  1. The MemberBase type does not include the Display attribute.
  2. The OperationValue type does not include the Display attribute either, meaning that even if it is passed during a patch operation, it is not updated in Member/MemberBase.
  3. And this bit in ProtocolExtensions needs to be updated as well to map Display from OperationValue to MemberBase. https://github.com/AzureAD/SCIMReferenceCode/blob/12f21fbe90a09cc7acf8f834da73f482e3af9a34/Microsoft.SystemForCrossDomainIdentityManagement/Protocol/ProtocolExtensions.cs#L163-L167

On top of that, it seems $ref is also completely missing.

egil avatar Mar 23 '22 16:03 egil