POST to Create enterprise user returns internal server error 500
After upgrading from version 2.0.9 to 2.0.15 of SimpleIdServer, I'm getting internal server error 500 response in the creation of a new enterprise user with POST to "/scim/Users" with the following json body:
{
"schemas": [
"urn:ietf:params:scim:schemas:core:2.0:User",
"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User"
],
"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User": {
"department": "sales",
"manager": {
"value": "19d216e6-a2cd-4b1f-a51c-9f98fa1ebc4c"
}
},
"userName": "UserName222",
"active": true,
"displayName": "lennay",
"externalId": "e1f4c134-2dec-4754-bb50-9e786e4ecae9",
"name": {
"formatted": "Andrew Ryan",
"familyName": "Ryan",
"givenName": "Andrew"
},
"emails": [
{
"primary": true,
"type": "work",
"value": "[email protected]"
},
{
"primary": false,
"type": "home",
"value": "[email protected]"
}
]
}
The token header is also present in the request with "Authorization": "Bearer ...".
This request is part of an End-2-End test in our solution that uses SimpleIdServer, so the request between both versions is exactly the same.
It seems like a bug was introduced in the recent versions.
The response from the server is:
[2022-08-09T12:19:47.5478801+00:00][EROR][1a3521031592][109][SimpleIdServer.Scim.Api.UsersController] Object reference not set to an instance of an object.
System.NullReferenceException: Object reference not set to an instance of an object.
at SimpleIdServer.Scim.Helpers.RepresentationReferenceSync.BuildScimRepresentationAttribute(String attributeId, SCIMRepresentation targetRepresentation, SCIMRepresentation sourceRepresentation, String sourceResourceType, SCIMSchema targetSchema)
at SimpleIdServer.Scim.Helpers.RepresentationReferenceSync.UpdateScimRepresentation(SCIMRepresentation scimRepresentation, SCIMRepresentation sourceRepresentation, String attributeId, String resourceType, SCIMSchema targetSchema, Boolean& isAttrUpdated)
at SimpleIdServer.Scim.Helpers.RepresentationReferenceSync.AddReferenceAttributes(RepresentationSyncResult result, IEnumerable`1 ids, SCIMAttributeMapping attributeMapping, SCIMRepresentation sourceScimRepresentation, String location, SCIMSchema targetSchema)
at SimpleIdServer.Scim.Helpers.RepresentationReferenceSync.Sync(IEnumerable`1 attributeMappingLst, String resourceType, SCIMRepresentation oldScimRepresentation, SCIMRepresentation newSourceScimRepresentation, String location, Boolean updateAllReferences, Boolean isScimRepresentationRemoved)
at SimpleIdServer.Scim.Helpers.RepresentationReferenceSync.Sync(String resourceType, SCIMRepresentation oldScimRepresentation, SCIMRepresentation newSourceScimRepresentation, String location, Boolean updateAllReferences, Boolean isScimRepresentationRemoved)
at SimpleIdServer.Scim.Commands.Handlers.AddRepresentationCommandHandler.Handle(AddRepresentationCommand addRepresentationCommand)
at SimpleIdServer.Scim.Api.BaseApiController.InternalAdd(RepresentationParameter jobj)
Hello,
Indeed there is a regression in the version 2.0.15. The issue should be fixed now, can-you please try the nuget package : https://www.myget.org/feed/advance-ict/package/nuget/SimpleIdServer.Scim version 2.0.16-ci-00324.
KR,
Sid
I tested it with v2.0.16-ci-00324 and it worked.
Is there an approximate release date for v2.0.16? It solves several issues that were affecting us (this one #309, #311 and #312). Thanks in advance!
Hello,
The release 2.0.16 will be published next week 29 August .
KR,
SID
SimpleIdServer released v2.0.17 in nuget, but github releases are not yet updated since v2.0.15. Just to let you know in case it was a missing point.