开发者

Listening to successful login with Spring Security

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?

开发者_如何学JAVAThanks!


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜