mirror of
https://github.com/pocket-id/pocket-id.git
synced 2025-12-06 09:13:19 +03:00
🚀 Feature: Allow custom claims #482
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 @tiehfood on GitHub.
Feature description
Would be great if I could add custom claims to the token and set the content in the user settings page.
Pitch
Some applications scrape additional information from claims. That could be a customer number, a group number a specific username field or any other information.
Implementation could be very simple. On the user page a button to add a button to create a new textfield. On creation give that field a name that corresponds to the claim name. Value could then be set per user.
@donkevlar commented on GitHub:
Hey, I just downloaded your dev image. This is super cool, testing it out now with a few of my apps. Ill report back if I run into any issues. Great work!
@stonith404 commented on GitHub:
I wanted to provide a quick update: I’ve completed the initial version of this feature, but I’m not entirely satisfied with the current solution. It may take a bit more time to refine it, but rest assured, I haven’t forgotten about this request.
@stonith404 commented on GitHub:
I'm working on support for user groups. Do you think it would make sense to also allow to set custom claims for user groups or is this only necessary for users?
@tiehfood commented on GitHub:
For sure that would make sense. Don't know how much effort that is, for my purpose you could keep it very simple :)
Great work
@stonith404 commented on GitHub:
I've just finished the first version. Would you mind to test the
stonith404/pocket-id:developmentimage and give me some feedback about what you would change?@stonith404 commented on GitHub:
@donkevlar Thanks, I've added custom claims to user groups.
@stonith404 commented on GitHub:
This has been added in
v0.12.0.⚠️ For all that have used the development image make sure to run these commands before upgrading!
@stonith404 commented on GitHub:
@donkevlar Thanks for the feedback. Also let me know if you find something not good in terms of user experience because I've never used custom claims before.
@donkevlar commented on GitHub:
So overall works well, my only feedback (which might not be valid because I don't really know much about openID) is that it would be nice to have the groups have some sort of claims available to inherit as users. For example if I add a claim that might be specific to a custom application such as {type: userRole, value: admin}, to do this every time versus just adding them to a group makes things much easier. Again, Im not an OID expert, so not sure if thats done through other means. The current implementation works well on a single user basis though, and I did not have issues parsing a response to the profile scope on my test apps.