How to add some own logic in user login in Spring Security 3
I am using spring Security of login and its working fine.
I h开发者_JAVA百科ave field in database in user entity
boolean confirmed
I want
If confirmed field is set to false , then comes the authentication error and tells user that email is registered but not confirmed and should allow the user to resend the activation link again
Create a ROLE_CONFIRMED and have most of your pages set to access="ROLE_CONFIRMED".
Then create a AuthenticationSuccessHandler and, if the user does not have ROLE_CONFIRMED redirect to the page that tells them that "email is registered but not confirmed and should allow the user to resend the activation link again".
When the user does confirm their email give them ROLE_CONFIRMED.
精彩评论