User login attempt is revealing the locked out status
Once the user is locked out, any attempt to login with bad password results in locked out status. Hence it reveals that user with that username exists. I am trying to change that to just show invalid attempt message. It is part of SignInManager.PasswordSignInAsync and it always return IsLockedOut status even if it is invalid password. I think it would be better to return Failed.
The app is free to treat IsLockedOut as other password failures. We left that decision to the callee to interpret and use how they will, otherwise they would have no way to detect the difference.
See here: https://github.com/aspnet/Identity/blob/dev/samples/IdentitySample.Mvc/Controllers/AccountController.cs#L58
You can simply not check for IsLocked out and fall into the general error case
It does not resolve my issue. :worried:
Test scenario
- Try to login with bad password for a locked out user.
SignInManager.PasswordSignInAsync will always return SignInResult.LockedOut.
So I will never know from the application code that password was bad unless I call thisUserManager.CheckPasswordAsync(user, password) and return Invalid attempt myself. The result is not very clear. Both results would be correct (Lockout, and Invalid Attempt). I think result object can be expanded more with more granular result status. (just an idea)
Thanks