Hi @Shelly Goel ,
To add custom claims in the token, custom attributes need to add in the user flow.
Azure AD B2C provide you the flexibility to add custom attributes as per scenario along with pre-defined built attributes.
To add custom attributes, In your Azure AD B2C directory,
- Select User attributes, and then select Add.
- Provide a Name for the custom attribute (for example, "Groups")
- Choose a Data Type. Only String, Boolean, and Int are available.
- Optionally, enter a Description for informational purposes.
- Select Create.
This custom attribute (which is now User Attributes) need to add in User Attributes and Application Claims of your User Flow.
User Attributes:
Application Claims:
Now Groups is added in the list of attributes which need to collect during the sign-up journey, and the value of that can be seen in token sent back to your application.
I have provide "Azure B2C" value in groups during Sign Up process which is populated in the token below.
Reference Docs : https://learn.microsoft.com/en-us/azure/active-directory-b2c/user-flow-custom-attributes?pivots=b2c-user-flow
Hope this helps to give better understanding.
Thanks,
Shweta
-----------------------------------------------------------
Please remember to "Accept Answer" and Up-Vote if answer helped you.