I\'ve an ASP.NET Core (based on .NET Framework) using Windows Authentication. Point is, I need to add a role claim on that user and this role is stored in a distant database
Well beside the answers, I just found the answer which is totally predefined in asp .net core. When you are adding claims just :
var claims = new List
{
new Claim(ClaimTypes.Name, UserName),
new Claim(ClaimTypes.Role, "User"),
new Claim(ClaimTypes.Role, "Admin"),
new Claim(ClaimTypes.Role, Watever)
};
after that you can just use it as said:
[Authorize(Roles = "Watever")]
or
User.IsInRole("Watever")