Kentico 12 MVC User Authentication

Jon Bowen asked on October 3, 2019 16:29

I'm using Identity Framework for user authentication as described here. When the user enters a wrong password, the method SignInManager.PasswordSignInAsync is throwing an error stating the IncrementAccessFailedCountAsync method is not implemented. Any help would be greatly appreciated.

Thanks in advance

Recent Answers


Eric Dugre answered on October 4, 2019 21:17

Hello Jon,

How is your authentication initialized? Have you made an changes to the UserManager?

By default, user lockout is disabled in our UserManager. The IncrementAccessFailedCountAsync() is indeed not implemented, but it also shouldn't be triggered by default.

0 votesVote for this answer Mark as a Correct answer

Jon Bowen answered on October 7, 2019 13:25

I was making the call to authenticate users this way

SignInManager.PasswordSignInAsync(model.Email, model.Password, false, true);

The last boolean parameter was set to true, causing the exception when the credentials were wrong. Changing to false stopped the exceptions, but it is frustrating that account lockout isn't implemented by default. I didn't see a way to override IncrementAccessFailedCountAsync in a derived UserManager or SignInManager class. What is the recommended way to implement account lockout?

0 votesVote for this answer Mark as a Correct answer

Kevin Spencer answered on October 24, 2019 15:31

I am also having this issue. Is there any guidance for MVC?

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.