토큰으로 로그인하는 다른 방법을 사용자에게 제공하려고합니다. 나는 이미 PreAuthenticationFilter 클래스에서 사용자를 인증 처리하지만 내가 발사 할 필요가 내 안에 방법을 발생시키는Spring을 사용하여 수동으로 AuthenticationSuccessHandler를 실행하는 방법
super.onAuthenticationSuccess()
을 수행
AuthenticationSuccessHandler.onAuthenticationSuccess()
는
SavedRequestAwareAuthenticationSuccessHandler.
내 preauthentication 필터에서 AuthenticationSuccessHandler
? 나는 의 인증 설정을 시도하여 자동으로 AuthenticationSuccessHandler
을 시작한다고 생각했지만 그렇지 않습니다. 이것은 내가 그렇게하려고 시도한 방법입니다.
Authentication authentication = new UsernamePasswordAuthenticationToken(Username, Password);
SecurityContextHolder.getContext().setAuthentication(authentication);
불행히도, 그것은 작동하지 않습니다. 따라서 미리 인증 필터에서 AuthenticationSuccessHandler
을 발사하는 방법을 알아야합니다.