I am implementing IdentityServer4 for client. Here i am bit confused in generating and setting claims, in ProfileService .
Scenario:
1) Users can belongs to multiple companies.
2) Users can have one role in one company.
3) User can have different roles in different companies.
E.g. User => Alice belongs to companyX and companyY.
a) Alice has role 'Admin' in companyX
b) Alice has role 'User' in CompanyY
Issue: What is the best way to set claims.? How at client side. i can determine which user role belongs to which companyid. if i am setting claims separately like
new Claim("name", "Alice"),
new Claim("Role","Admin"),
new Claim("Role","Cat"),
new Claim("Comp","1"),
new Claim("Comp","2"),
another approach could be to set claims like.
new Claim("name", "Alice"),
new Claim("Company_Role","1_Admin"),
new Claim("Company_Role","2_Cat"),
I am not sure if this is the best approach. Can anyone suggest me.?