Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var claims = new List<Claim>
- {
- new Claim(ClaimTypes.Name, user.Email),
- new Claim("FullName", user.UserName),
- new Claim(ClaimTypes.Role, "user"),
- };
- var claimsIdentity = new ClaimsIdentity(
- claims, CookieAuthenticationDefaults.AuthenticationScheme);
- AuthenticationProperties props = null;
- props = new AuthenticationProperties
- {
- IsPersistent = true,
- // ExpiresUtc = DateTimeOffset.UtcNow.Add(AccountOptions.RememberMeLoginDuration)
- };
- await HttpContext.SignInAsync(AuthenticationDefaults.AuthenticationScheme,
- new ClaimsPrincipal(claimsIdentity),
- props);return Ok(rmodel);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement