Quantcast
Channel: Security
Viewing all articles
Browse latest Browse all 4737

Admins unlock an account.

$
0
0

Ok, I have seen the code to enable retry lockouts, 

public async Task<ActionResult> Login(LoginViewModel model, string returnUrl)
{
... 

SignInManager.UserManager.DefaultAccountLockoutTimeSpan = new TimeSpan(1, 0, 0);
SignInManager.UserManager.MaxFailedAccessAttemptsBeforeLockout = 5; //5 was default
var result = await SignInManager.PasswordSignInAsync(model.Email, model.Password, model.RememberMe, shouldLockout: true);

now I want to put a link on the user manager screen that 

  1. only appears if a user is Retry Locked Out.  (Somehow read the ASPNetUser from the ApplicationUser and check the lockout status)
  2. Executes the await UserManager.ResetAccessFailedCountAsync(userId); command when clicked.

the only problem I am having is that the framework has created so many levels of obfuscation that I cant see how to get the lockout status of an "ApplicationUser"


Viewing all articles
Browse latest Browse all 4737

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>