반응형
1. Http Request 요청
2. AuthenticationFilter
username와 password를 조합하여 UsernamePasswordAuthenticationToken 생성
3. AuthenticationManager<<interface>>에 Token 전달
AuthenticationManager에서 Token이 유효한지 검증 → 구현체인 ProviderManager에서 Token에 대한 인증 처리
4. UserDetailsService에서 loadUserByUsername() 함수를 호출하여 DB에 접근하고 정보가 존재하면 UserDetails 타입으로 반환
(인증 성공하면 AuthenticationManager는 Authentication 객체를 반환)
5. SecurityContextHolder.getContext().setAuthentication()으로 세팅
반응형
'스프링' 카테고리의 다른 글
[Spring] 스프링부트 스케줄러 사용하기 (0) | 2022.03.29 |
---|---|
[Spring] application.properties 또는 application.yml 파일에 미리 값을 지정해둔 다음 사용하기 (0) | 2022.03.29 |
스프링부트에서 JSP 로 화면 보여주기 (0) | 2022.02.17 |
스프링 시큐리티 + Ajax post → 403 에러 (0) | 2022.01.29 |
WebSecurityConfigurerAdapter의 configure() 오버라이딩 (0) | 2022.01.27 |