Exemplo n.º 1
0
 private async Task CookieSignInAsync(ApplicationUser user, bool persist = false)
 {
     await HttpContext.SignInAsync(
         UserHelperExtensions.CookieAuthScheme,
         UserHelperExtensions.GetCookieClaimsPrincipal(user),
         UserHelperExtensions.GetAuthenticationProperties(persist));
 }
Exemplo n.º 2
0
 private async Task JwtSignInAsync(ApplicationUser user, bool persist = false)
 {
     var display = user.Displayname ?? user.Username;
     await HttpContext.SignInAsync(
         $"{user.Id}",
         user.Username,
         UserHelperExtensions.GetAuthenticationProperties(persist),
         new Claim(JwtClaimTypes.Id, $"{user.Id}"),
         new Claim(JwtClaimTypes.NickName, display),
         new Claim(JwtClaimTypes.Name, display));
 }