Spring security not hitting default-target-url after successful authtication

前端 未结 4 1214
暗喜
暗喜 2020-12-10 14:21

I have implemented spring-security in my application, my spring-security.xml has following form-login tag.



        
4条回答
  •  南方客
    南方客 (楼主)
    2020-12-10 14:37

    
        
        
    
    
    public class LoginSuccessHandler extends SavedRequestAwareAuthenticationSuccessHandler {
    
         @Override
         public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response,
                                        Authentication authentication) throws ServletException, IOException {
             request.getSession().setMaxInactiveInterval(60 * 60); //one hour
             System.out.println("Session set up for 60min");
             super.onAuthenticationSuccess(request, response, authentication);
          }
    }
    

提交回复
热议问题