I am trying to get user information after login in ASP.NET Core 3.1 (information like name, email, id, ...).
Here is my code in login action
var claims = new List<Claim>()
{
new Claim(ClaimTypes.NameIdentifier, "NameIdentifire"),
new Claim(ClaimTypes.Name, "Name"),
new Claim(ClaimTypes.Email, "Email")
};
var identity = new ClaimsIdentity(claims, CookieAuthenticationDefaults.AuthenticationScheme);
var principal = new ClaimsPrincipal(identity);
HttpContext.SignInAsync(principal);
In the views I only access the name by looking at @User.Identity.Name. My question is: how to get other information user in different views?
