Spring - Take some action after login

I need to save the actual date in the database after a successful login. How to do it? Filter, handler, or something else? Help is needed.

+5
source share
1 answer
    public class AuthenticationSuccessHandlerImpl extends SimpleUrlAuthenticationSuccessHandler {
           @Override
       public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) 
       throws IOException, ServletException {
       //your code here    
     }
}

configurations:

<beans:bean id="authSuccessHandler"
            class="your.pachage.decleration.AuthenticationSuccessHandlerImpl"/>
+6
source

All Articles