vaibought
vaibought

Reputation: 461

Show captcha after three wrong attempts by the user

I am working on a application where at some places I need to introduce captcha if N number of attempts failed. These places can be signup, login, add to wishlist, subscribe etc. It is also to ensure that denial of service attack and brute force attack cannot be attempted by anyone. Is there a mechanism for this in Spring Security?

Upvotes: 8

Views: 5351

Answers (4)

Aravindan R
Aravindan R

Reputation: 3084

If you are using reCAPTCHA with Spring Security, this is helpful http://krams915.blogspot.com/2011/02/spring-security-3-integrating-recaptcha.html

Upvotes: 0

sourcedelica
sourcedelica

Reputation: 24040

Implement an AuthenticationFailureHandler that updates a count/time in the DB. You can't count on using the session because the attacker is not going to be sending cookies anyway.

Upvotes: 7

nfechner
nfechner

Reputation: 17525

There is nothing in Spring Security directly, but it should be easy to store the login count in the users session and check that count in your JSP to render a CAPTCHA is neccessary.

Upvotes: 9

Related Questions