Adding roles from a DB Table
- by Sunil Ramu
Can anyone expalin me how to dynamically ger the Role from a DB table instead of hard coding it in the code.
ClaimsIdentity outputIdentity = new ClaimsIdentity();
outputIdentity.Claims.Add(new Claim(System.IdentityModel.Claims.ClaimTypes.Name, principal.Identity.Name));
outputIdentity.Claims.Add(new Claim(ClaimTypes.Role, "Manager"));
outputIdentity.Claims.Add(new Claim(ClaimTypes.Country, HttpUtilities.GetProgramIdentifierFromUrl()));
return outputIdentity;