Duplicate Claims in UserClaims Table When Adding via Postman or UI
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"
}
]
}
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
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.
Hello,
There is indeed an issue in the implementation. :( The issue has been fixed in the origin/Release503 branch.
KR, SID