I have a web application in MVC 6 (Asp.Net One Core) and I use claims-based authentication. In the Login method, I install Claims:
var claims = new Claim[] { new Claim("Name", content.Name), new Claim("Email", content.Email), new Claim("RoleId", content.RoleId.ToString()), }; var ci = new ClaimsIdentity(claims, "password"); await HttpContext.Authentication.SignInAsync("Cookies", new ClaimsPrincipal(ci));
Now, if the user, for example, has changed the email address in the user profile, how can I change the email value for the "Email" request? Do I need to activate SignOutAsync and SignInAsync again to update the cookie? Is the best solution to keep this in a classic session? Is there a better solution? Am I absolutely wrong?
Any suggestions?
source share