How can I add logic to Symfony2's authentication method?
for example, blocking one's login attempts after certain amount of failed logins.
How can I add logic to Symfony2's authentication method?
for example, blocking one's login attempts after certain amount of failed logins.
You can do it in an authentication handler. Here is an example of an authentication handler which you can adapt to your needs.
You should define service that implements Symfony\Component\Security\Http\Authentication\AuthenticationFailureHandlerInterface and in method onAuthenticationFailure() you can increase attribute which handle number of attempts. If number reach limit you just switch user attribute enabled to false