1

How can I add logic to Symfony2's authentication method?

for example, blocking one's login attempts after certain amount of failed logins.

2
  • Are you using the FOSUserBundle??? Commented Jan 28, 2012 at 15:01
  • nope, I use my own user bundle Commented Jan 28, 2012 at 18:09

2 Answers 2

1

You can do it in an authentication handler. Here is an example of an authentication handler which you can adapt to your needs.

Sign up to request clarification or add additional context in comments.

Comments

0

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

1 Comment

there's no way for altering the authentication method itself?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.