SecurityConfig를 설정할 때 우리는 어떤 권한이 있을 때 어떤 주소에 접속할 수 있다.
혹은 로그인 페이지를 등록하거나 시큐리티가 로그인을 대신 진행하게 설정해줄 수 있는 config이다.
여기서 우리는 SpringBoot
의 HttpSecurity
를 사용하게 되는데 http.formLogin();
을 사용하면 Security에서는 UsernamePasswordAuthenticationFilter
를 사용하게 된다.
Form based Authentication 방식으로 인증을 진행할 때 id, password를 파싱하여 인증 요청을 위임하는 필터이다.
밑에처럼 HttpSecurity 설정 config에서 http.formLogin() 메서드를 사용하면 Security에서 UsernamePasswordAuthenticationFilter
를 사용한다.
@Override
protected void configure(HttpSecurity http) throws Exception {
http.formLogin();
}