I want to perform several actions when a User successfully logs in to my app, this actions need some User data as parameters, so is there a way to listen to successful logins with Spring Security 3.0.x? Or any other way to accomplish this?
Thanks!
Use an AuthenticationSuccessHandler
<form-login authentication-success-handler-ref="authenticationSuccessHandler"/>
You can get the username from the Authentication (UsernamePasswordAuthenticationToken) that is passed to onAuthenticationSuccess() and then look up the other user info from there.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With