Skip to content

Instantly share code, notes, and snippets.

Created August 3, 2017 13:58
What would you like to do?
public async Task<IActionResult> Index()
var principal = User.Identity as ClaimsIdentity;
var idClaim = principal.Claims.Where(i => i.Type == "")
if(idClaim == null)
principal.AddClaim(new Claim("", "MyCustomId"));
await HttpContext.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme);
await HttpContext.SignInAsync(User);
return View();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment