Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate Claims in UserClaims Table When Adding via Postman or UI #828

Open
HappyRoot opened this issue Dec 25, 2024 · 3 comments
Open
Assignees
Labels
bug Something isn't working question Further information is requested

Comments

@HappyRoot
Copy link

Hello, and thank you for your great work!

In version 5.0.2, when adding claims using either Postman or the UI — regardless of the method — the claims are consistently duplicated in the UserClaims table. This behavior seems suboptimal and might indicate an issue.

Example Request:

POST https://localhost:5001/master/users/{{userId}}/claims
Content-Type: application/json

{
  "claims": [
    {
      "name": "permissions",
      "value": "can_block_objects"
    },
    {
      "name": "permissions",
      "value": "objects_manager"
    }     
  ]
}
@simpleidserver simpleidserver self-assigned this Dec 31, 2024
@simpleidserver simpleidserver added the question Further information is requested label Dec 31, 2024
@simpleidserver simpleidserver moved this to In Progress in Release 5.0.3 Dec 31, 2024
@simpleidserver
Copy link
Owner

Hello, and thank you for your interest in SimpleIdServer! 🙂

It is normal for the UserClaims table to contain multiple records for the same claim. 🙂
In your example, a user can have one or more permissions, such as can_block_objects and objects_manager.
The permissions claims will be transformed into an array by SimpleIdServer and included in the access/identity token.

KR,
SID

@HappyRoot
Copy link
Author

Image

The issue is that if multiple requests to update claims are made, the old ones are not removed, and the userId is set to null, leaving behind 'garbage' records in the database.

@simpleidserver simpleidserver added the bug Something isn't working label Jan 12, 2025
thabart added a commit that referenced this issue Jan 12, 2025
@simpleidserver
Copy link
Owner

Hello,

There is indeed an issue in the implementation. :(
The issue has been fixed in the origin/Release503 branch.

KR,
SID

@simpleidserver simpleidserver moved this from In Progress to Done in Release 5.0.3 Jan 12, 2025
@simpleidserver simpleidserver closed this as completed by moving to Done in Release 5.0.3 Jan 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
Status: Done
Development

No branches or pull requests

2 participants