SPRING SEQURITY - Form Login 인증 흐름, AuthenticationFilter
2021. 4. 15. 11:09ㆍSPRING/SPRING SECURITY
- 로그인 요청을 한다.
- AuthenticationFilter가 요청을 받아, RequestMatcher를 생성해 요청 정보가 매칭되는지 확인한다.
- 요청정보가 매칭된다면 인증객체(Authentication)을 생성한다.
- AuthenticationManager에게 인증 객체를 이용해 인증 요청을 하고 AuthenticationManager는 AuthenticationProvider에게 인증 요청을 위임한다.
- AuthenticationProvider는 인증 객체를 분석하여 username, password를 보고 인증 성공 여부를 판단한다.
- 인증이 성공되면 AuthenticationManager는 인증객체를 새로 생성한다. 이 때, 인증객체는 사용자 정보와, 권한 정보를 가진다.
- 해당 인증객체를 SecurityContext에 저장한다. 이로써 어디에서든 인증객체를 참조할 수 있게 된다.
- SuccessHandler에게 인증객체를 넘겨주며 로그인 성공시 수행해야할 로직을 실행한다.
'SPRING > SPRING SECURITY' 카테고리의 다른 글
Spring Security - 익명 사용자 인증, AnonymousAuthenticationFilter (0) | 2021.04.15 |
---|---|
Spring Security - Remember me, 자동 로그인 API, RememberMeAuthenticationFilter (0) | 2021.04.15 |
Spring Security - Logout 흐름, LogoutFilter (0) | 2021.04.15 |
Spring Security - Logout API (0) | 2021.04.15 |
SPRING SEQURITY - Form Login 인증 API (0) | 2021.04.15 |