Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Login - Allow only 3 attempts

Tags:

c#

asp.net

I am creating a new application..I created a login page successfully..Now I need to modify the login page ..Only 3 attempts only allowed for a user ..If the user wrongly enters the password more than 3 times(within 5 min) his account must be blocked..And error message must be shown as You cant access your page ..Please share your ideas...

like image 562
Jafry Avatar asked Oct 21 '10 13:10

Jafry


People also ask

How do I limit the number of login attempts?

In order to limit login attempts on your WordPress site, you can follow two simple steps: Install a dedicated plugin, such as Limit Login Attempts Reloaded. Configure the plugin's settings, and let it do its job.

How do I limit the number of login attempts in Spring Security?

Solution. Review the existing Spring Security's authentication class, the “locked” feature is already implemented. To enable the limit login attempts, you need to set the UserDetails. isAccountNonLocked to false.

How do I get rid of limit login attempts in WordPress?

You need to access your site using your FTP client or file manager, and then go to the /wp-content/plugins/ folder. Once you're there, you can simply delete the limit-login-attempts-reloaded plugin folder. You can now log in to your WordPress admin area.


1 Answers

use a MembershipProvider and in your web.config, in system.web you can configure number of attempts and timeouts. Set maxInvalidPasswordAttempts="3" and passwordAttemptWindow="5" for your requirements.

<membership defaultProvider="MyMembershipProvider">
  <providers>
    <clear/>
    <add name="MyMembershipProvider"
         type="MyMembershipProvider"
         autogenerateschema="true"
         connectionStringName="MyConnectionString"
         enablePasswordRetrieval="false"
         enablePasswordReset="true"
         requiresQuestionAndAnswer="false"
         requiresUniqueEmail="false"
         passwordFormat="Hashed"
         maxInvalidPasswordAttempts="3"
         minRequiredPasswordLength="8"
         minRequiredNonalphanumericCharacters="1"
         passwordAttemptWindow="5"
         passwordStrengthRegularExpression=""
         applicationName="/"  />
  </providers>
</membership>

This will require some configuration, but when configured properly (maybe even with a roleprovider) the default asp.net Login Controls can handle almost everything for you, even a PasswordRecovery and CreateUserWizard. The MembershipProvider will generate all required tables for user registration automatically.

The database can be a mdb file, ms sqlserver or mysql database.

like image 150
Willem Avatar answered Oct 14 '22 18:10

Willem