actions v2
before actions v2 I had the flatRoles v1 action used to add the role name to my claims. in v2 is this only possible if I run a separate endpoint for the function?
2 Replies
Hi @Dohvaken, I'm an AI assistant for ZITADEL. While a team member reviews this question, I'll see if I can find relevant sources for your question.
Answer
Unfortunately, adding custom claims to tokens is not currently possible with Actions v2 (1) . According to the available information, Actions v2 only supports adding information to API requests and responses, not to tokens or claims .
For flat roles claims functionality, you would need to continue using Actions v1 (2) (3) . The Actions v1 approach allows you to add custom claims using the complement token flow:
This functionality remains available through Actions v1's complement token triggers for Pre Userinfo creation and Pre access token creation (2) (4) .
To learn more, see the sources I considered:
[1] Actions V2 - Adding claims to token
[2] Claims in ZITADEL
[3] Code examples
[4] Retrieve User Roles in ZITADEL
Feel free to tag @Ask Inkeep with additional questions.
Got it. Tagging @Rajat for additional help.
hey @Dohvaken thanks for your question, I will look into it.