您最多选择25个主题
主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
28 行
1.0 KiB
28 行
1.0 KiB
package com.aiprose.scauth.handler;
|
|
|
|
import org.springframework.security.core.Authentication;
|
|
import org.springframework.security.web.authentication.AuthenticationSuccessHandler;
|
|
|
|
import javax.servlet.ServletException;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import java.io.IOException;
|
|
|
|
/**
|
|
* @author nelson
|
|
* @desc TODO
|
|
* @company 北京中经网软件有限公司
|
|
* @date 2020/11/27 16:15
|
|
* @since 1.0
|
|
*/
|
|
public class LoginSuccessHandler implements AuthenticationSuccessHandler {
|
|
@Override
|
|
public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, ServletException {
|
|
System.out.println("login success");
|
|
System.out.println(authentication.getDetails());
|
|
System.out.println(authentication.getAuthorities());
|
|
System.out.println(authentication.getCredentials());
|
|
System.out.println(authentication.getPrincipal());
|
|
response.sendRedirect("/home");
|
|
}
|
|
}
|
|
|