# Bug OP-19099 - SCIM User API returns duplicate records

Project: OpenProject
Status: closed
URL: https://community.openproject.org/work_packages/OP-19099

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | High |
| Module | API / SCIM |
| Target versions | 17.4.0 |
| Observed in versions | 17.2.0 |
| Sprint |  |
| Backlog bucket |  |
| Bug found in version (deprecated) | 17.2.x |
| Found in mobile app version |  |
| Follow-up feedback e-mail |  |
| Requires doc change | No |
| Accessibility | No |
| Pull preview |  |
| List |  |
| Labels |  |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable |  |
| Product manager |  |
| Developers | Pavel Balashou |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Planning

| Attribute | Value |
| --- | --- |
| Relevance |  |

## Costs

| Attribute | Value |
| --- | --- |
| Votes |  |
| Work |  |
| Labor costs |  |

## Description

### Steps to reproduce

1.  Login as a user with permissions to manage members in project A

2.  Create a entra openID provider details in the authentication tab in administration.

3.  Create scim client.Get the token and use it in the below curl request.  
    curl -X GET "<https://openproject.example.com/scim\_v2/Users?filter=userName%20eq%20%22&lt;user@example.com&gt;%22>" \\
    
    \-H "Authorization: Bearer \<TOKEN\>
    
    \-H "Accept: application/scim+json"

4.  Add user to two groups and you will start getting two user records.

### What is the buggy behavior?

  - User response is duplicated due to multiple group membership

### What is the expected behavior?

  - Resources **must list each user at most once** (unique `id` per SCIM user resource in the list response).

  - For a user in multiple groups, there should be **a single** `Resources` entry for that user, and the **groups** (or equivalent) attribute should still list **all** group memberships—not duplicate user rows.

**OpenProject installation type**

  - Hosted cloud edition

  - Packaged installation
    
      - What distribution?

  - Docker All-in-one container

  - Docker-compose installation

  - Other (please specify)

**OpenProject version**

*If you're not running on the cloud edition, please specify the version of OpenProject you're running. Example: v12.1.5*
