Skip to content

[SCIM] GET Request Returns 500 for Non-Existing Resource with Query Filter #917

@dimOk00

Description

@dimOk00

Description

A SCIM GET request for a non-existing resource with the excludedAttributes query parameter returns a 500 Internal Server Error instead of a 404 Not Found.

Steps to Reproduce

  1. Send a GET request:
    /groups/9f643ab8-e5ca-4a0b-92da-76aef05b44dd?excludedAttributes=members
    

Expected Behavior

Returns a 404 Not Found response:

{
  "schemas": ["urn:ietf:params:scim:api:messages:2.0:Error"],
  "status": "404",
  "scimType": "unknown",
  "detail": "resource 9f643ab8-e5ca-4a0b-92da-76aef05b44dd not found"
}

Actual Behavior

Returns a 500 Internal Server Error:

{
  "schemas": ["urn:ietf:params:scim:api:messages:2.0:Error"],
  "status": "500",
  "scimType": "internalServerError",
  "detail": "Object reference not set to an instance of an object."
}

Logs

[17:34:36 ERR] 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.Persistence.EF.Extensions.EFSCIMExpressionLinqExtensions.BuildResult(...)
   at SimpleIdServer.Scim.Persistence.EF.EFSCIMRepresentationQueryRepository.FindSCIMRepresentationById(...)
   at SimpleIdServer.Scim.Queries.GetRepresentationQueryHandler.Handle(...)
   at SimpleIdServer.Scim.Api.BaseApiController.InternalGet(...)

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions