Locking out a user in an ASP .Net Custom Membership Provider

后端 未结 4 756
别跟我提以往
别跟我提以往 2021-02-09 13:42

I\'ve had to create a custom membership provider for my current ASP .Net project in order to fit in with our database schema, and am having problems configuring it to lockout a

4条回答
  •  萌比男神i
    2021-02-09 14:07

    In your custom membership provider, you should implement the ValidateUser function. There you not only check if the username and password are valid, but you also retrieve the number of invalid password attempts etc from your datastore. If the username/password is valid, reset the password attempt count, otherelse increase the attempt count. The SqlMembershipProvider also stores the LastAttempt datetime, so you cannot bruteforce you way in because you are not allowed to attempt within a certain time frame.

提交回复
热议问题