-1

In my java application, I am going to lock the account if someone does not enter the correct password 6 times. I am going to add a field in my local database that indicates if a user's account is locked or not. However, how can I unlock this account? For example, I may want to unlock their account after 15 minutes. What is the best way to go about unlocking a user's account?

drake
  • 259
  • 4
  • 17
  • 3
    Store the time the user's account was locked as well. Compare the current time to the time it was locked to determine if it is unlocked. – amza Jul 28 '15 at 21:16

2 Answers2

2

I would only store the date and time that indicates when the user account is going to be unblocked.

So when that date/time is "larger" than the current time, the user is able to access the account.

Whenever the date/time is "smaller" than the current time, the user isn't able too.

CPUFry
  • 566
  • 4
  • 18
0

Store a "high water mark" time for it to unlock. Each time the user violates the # of failed tries etc refresh it.

TheFiddlerWins
  • 860
  • 5
  • 19