mirror of
https://github.com/pocket-id/pocket-id.git
synced 2026-02-05 00:39:38 +03:00
🐛 Bug Report: Custom Claims with same key overrides previous defined values #625
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @etho201 on GitHub (Jan 26, 2026).
Reproduction steps
If a user belongs to multiple groups, and you assign a custom claim to each group, the key-value pairs seem to conflict when the same key (but different value) is defined in more than one group.
For example:
I have Pocket-ID configured with both OCIS and OpenCloud. OpenCloud is a fork of OCIS so the way it is configured with OIDC is nearly identical. The difference is you have a group called
ocisAdmin, and a group calledopencloudAdmin. For theocisAdmingroup you are to add a custom claim key-value pair calledroles:ocisAdmin, and for theopencloudAdmingroup you are to add a custom claim key-value pair calledroles:opencloudAdmin.After doing this, if you click on `OIDC Data Preview" you will only see one of the values (probably whichever one was added most recently).
The only way around this is to instead define the custom claims at the user level instead, and it needs to be defined in a very specific way. So if I want my admin user to have a key called
roleswith two values:ocisAdminandopencloudAdmin, I need to define it within an array list. The key isroles, the value needs to be defined as["ocisAdmin", "opencloudAdmin"].I'm happy to have found a workaround, but I think it would be far more elegant if Pocket ID could simply combine any key-value pairs that have the same key into an array list, rather than wiping out the previously defined key-value pair.
Expected behavior
I expected that if I define a key-value pair in a group, if the key is the same as another key defined in a different group, the user profile assigned to those groups would have both values for that key.
Actual Behavior
I define a key-value pair in a group, if the key is the same as another key defined in a different group, the user profile assigned to those groups only has the latest value for that key (as verified in the OIDC Data Preview).
Pocket ID Version
v2.2.0
Database
SQLite
OS and Environment
Docker on Armbian 25.11.2 jammy
Log Output
No response