Skip to content

Duplicate id in resource location #12

@jehervy

Description

@jehervy

Hi,

We spotted that the resource id is duplicate in the location property when we get a resource by id :

[~]$ curl -X GET "http://localhost:7750/scim/v2/Users/3ffe7ac4-f0bf-41ca-8c41-59839f5991e8" -H "accept: */*" -s | jq
{
  "schemas": [
    "urn:ietf:params:scim:schemas:core:2.0:User"
  ],
  "id": "3ffe7ac4-f0bf-41ca-8c41-59839f5991e8",
  "meta": {
    "created": "2022-06-15T07:20:22.522Z",
    "lastModified": "2022-06-21T15:32:28.111Z",
    "resourceType": "User",
    "location": "https://localhost:7750/scim/v2/Users/3ffe7ac4-f0bf-41ca-8c41-59839f5991e8/3ffe7ac4-f0bf-41ca-8c41-59839f5991e8"
  }
}

It seems that the baseUri given to the ResourcePreparer already contains the resource id (see here).
And then the ResourcePreparer adds it again when the location is computed (see here).

For information, the endpoint is defined the following way :

@GetMapping(value = "/{id}")
public GenericScimResource get(@PathVariable("id") final String id,
                               @RequestParam(name = "attributes", required = false) String attributes,
                               @RequestParam(name = "excludedAttributes", required = false) String excludedAttributes)
        throws BadRequestException {
    return genericScimResourceConverter.convert(
            attributes,
            excludedAttributes,
            userService.getUser(id));
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions