This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
James Daniel wrote:I am using Spring Security 3.0.4 and would like to log when a user successfully logs in. What is the best way to do this?
Which UserDetailsService are you using. You can always customize it yourself. You can either implement UserDetailsService interface, it just has one method. Or you can extend the UserDetailsService you are using, have the first line of code call super.loadUserByUserName(userName) then the code after logs a message.
Or you can try using Spring AOP and define a pointcut expression that matches loadUserByUserName. and do an AfterSuccessful advice type.