如何在Login POST方法期间执行自定义步骤(使用spring boot)

时间:2017-09-17 09:36:39

标签: spring-boot

Spring boot提供了自己的登录实现(POST方法),如果我想维护用户登录成功/失败的历史记录(计数),我该怎么办?

1 个答案:

答案 0 :(得分:0)

让以下内容成功:

public class CustomAuthenticationSuccessHandler implements AuthenticationSuccessHandler{


@Override
public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication)
        throws IOException, ServletException {
    // TODO Auto-generated method stub
    ......
    }