@dml5 , thank you for reaching out to us. The first thing to do for setting up Feature Management is to map users
and groups
in whatever authentication method is being used for users/groups, specifically to create TargetingContext
instances for users. A TargetingContext
contains the user id and list of groups to which the user belongs. This information is used to position the current user in the audience that has been configured.
One way to build a TargetingContext
is to get it from the logged in user's context by getting the User.Identity
property:
var userClaims = User.Identity as System.Security.Claims.ClaimsIdentity;
I tested on my system and using this code but removing UserId
in TargetingContext
and it gives me inconsistent results as per configuration. So, I would recommend you to use UserId
and Groups
both to get reliable results.
Check out this article for a better understanding of implementation in .NET Framework by going through the logic and explanations in ASP.NET Core 3.1 MVC app (note that it is just for understanding the concepts). Further, do check out official documentation on Feature Flags.
-----------------------------------------------------------------------------------------------------------
Please "Accept the answer" if the information helped you. This will help us and others in the community as well.