imulab / go-scim

Building blocks for servers implementing Simple Cloud Identity Management v2
MIT License
145 stars 56 forks source link

Azure AD Patch request issues #75

Closed plamenGo closed 4 years ago

plamenGo commented 4 years ago

Hey, Azure posts the following when trying to PATCH a user:

{
"schemas":["urn:ietf:params:scim:api:messages:2.0:PatchOp"],
"Operations":[{
        "op":"Add","path":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:manager",
        "value":"45619541-95de-4d5e-9872-571b5d2c5577"}]
}

We are unable to parse and the get following error from go-scim:

{
    "schemas": [
        "urn:ietf:params:scim:api:messages:2.0:Error"
    ],
    "status": 400,
    "scimType": "invalidPath",
    "detail": "invalidPath: error compiling path"
}

I think the issue might be that manager is a complex attribute under the enterprise schema, but is sent over with a simple ID.

Do you know if this is a bug in go-scim of if we should format the PATCH request differently? Can you provide an example of what this request should look like so it works in go-scim.

Best Regards! Plamen

plamenGo commented 4 years ago

Same thing happens with the employee number field.

{"schemas":["urn:ietf:params:scim:api:messages:2.0:PatchOp"],"Operations":[{"op":"Add","path":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:employeeNumber","value":"6546579"}]}

This is not a complex field, so this leads me to believe that we're just not processing the path correctly

plamenGo commented 4 years ago

After digging some more it seems that the path compiler does not like the colons (:) in the path name -- it's not clear to me what I should do about it though. I suspect the (.) may trip it up as well. Any advice would be welcome!

imulab commented 4 years ago

@plamenGo looks like a very legit request, will take a look at this the day after.