Вы можете попробовать сгенерировать токен rest rest password и восстановить пароль, как показано ниже:
public class HomeController : Controller
{
private readonly UserManager<IdentityUser> _userManager;
public HomeController(UserManager<IdentityUser> userManager)
{
_userManager = userManager;
}
public async Task<IActionResult> Index()
{
return View();
}
public async Task<IActionResult> RestPassword()
{
var user = await _userManager.FindByEmailAsync("test@outlook.com");
var token = await _userManager.GeneratePasswordResetTokenAsync(user);
var result = await _userManager.ResetPasswordAsync(user, token, "2wsx#EDC");
return View();
}
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
public IActionResult Error()
{
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
}
}