SimpleIdServer icon indicating copy to clipboard operation
SimpleIdServer copied to clipboard

Error validating SCIM requests with `null` values

Open nwoolls opened this issue 1 year ago • 1 comments

If I post a SCIM POST request to the server with a null value for emails, I receive:

{
  "schemas": [
    "urn:ietf:params:scim:api:messages:2.0:Error"
  ],
  "status": "400",
  "scimType": "invalidValue",
  "detail": "attribute emails is not an array"
}

Similarly, if I POST a request with a null value for a schema attribute, I get an error as well:

{
    "schemas": ["urn:ietf:params:scim:schemas:core:2.0:User","urn:ietf:params:scim:schemas:extension:enterprise:2.0:User"],
    "externalId": "external",
    "userName": "{{$guid}}",
    "emails": null,
    "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User": null,
    "name": {
        "formatted": "formatted",
        "givenName": "givenName",
        "middleName": "middleName",
        "familyName": "familyName"
    }
}
{
  "schemas": [
    "urn:ietf:params:scim:api:messages:2.0:Error"
  ],
  "status": "400",
  "scimType": "invalidValue",
  "detail": "Property urn:ietf:params:scim:schemas:extension:enterprise:2.0:User cannot contains an array"
}

I can do some extra work serializing to omit nulls, but maybe this should be handled more gracefully by the server?

nwoolls avatar Dec 03 '24 19:12 nwoolls

The issue is fixed in the branch Release503 :

https://github.com/simpleidserver/SimpleIdServer/commit/6aa7c938257ab8006aa1746415300fbe364418b7

simpleidserver avatar Dec 04 '24 14:12 simpleidserver