I work on web application asp.net core 5 i can't modify action login
to accept 3 login attempt failed only .
if he try with wrong password or wrong email account after that then block it .
I using user identity login
what I try
C#
public async Task Login(LoginVM loginVM)
{
if (!ModelState.IsValid) return View(loginVM);
var user = await _userManager.FindByEmailAsync(loginVM.EmailAddress);
if(user != null)
{
var passwordCheck = await _userManager.CheckPasswordAsync(user, loginVM.Password);
if (passwordCheck)
{
var result = await _signInManager.PasswordSignInAsync(user, loginVM.Password, false, false);
if (result.Succeeded)
{
return RedirectToAction("Index", "Movies");
}
}
TempData["Error"] = "Wrong credentials. Please, try again!";
return View(loginVM);
}
TempData["Error"] = "Wrong credentials. Please, try again!";
return View(loginVM);
}can you help me by solution general working as session without using identity membership so i can use it on another login or another logic

Pankajkumar PatelRank #181 · 13.4K reputationPosted Dec 1, 2022, 11:10 PM EST
Hi Ahmed Salah,
For this there is one article "Spring Security Limit Login Attempts Example" with full example and link is as below:
Hope this will help you!
Amit MohantyRank #112 · 20K reputationPosted Dec 2, 2022, 12:08 AM EST
Check the below links
https://code-maze.com/user-lockout-aspnet-core-identity/
https://hoven.in/aspnet-core/acc-lockout-identity.html