Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring - Do some action after login

I need to store actual date in DB after a successful user login. How to do that ? Filter, handler or something ? Need help.

like image 903
marioosh Avatar asked Sep 07 '11 11:09

marioosh


People also ask

What is entry authentication spring?

AuthenticationEntryPoint is used in Spring Web Security to configure an application to perform certain actions whenever an unauthenticated client tries to access private resources.


1 Answers

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

config:

<beans:bean id="authSuccessHandler"
            class="your.pachage.decleration.AuthenticationSuccessHandlerImpl"/>
like image 63
fatnjazzy Avatar answered Sep 28 '22 02:09

fatnjazzy