-
Notifications
You must be signed in to change notification settings - Fork 0
Security Architecture
lsw71311 edited this page Apr 3, 2024
·
1 revision
1. 사용자의 요청이 서버로 들어오면, AuthenticationFilter (UsernamePasswordAuthenticationFilter)가 사용자의 자격 증명(이름, 비번) 확인.
2. 추출된 자격 증명을 이용해 UsernamePasswordAuthenticationToken을 생성.
3. 생성된 Token은 AuthenticationManager에 전달되어, 올바른 사용자로부터 온 것인지 확인.
4. AuthenticationManager는 등록된 AuthenticationProvider를 사용하여 Token 검증.
5. AuthenticationProvider는 UserDetailsService 구현 클래스를 호출하여, 해당 사용자에 대한 정보를 요청.
6. UserDetailsService 구현 클래스는 db에서 사용자 정보를 조회하여 UserDetails 객체를 반환.
7. AuthenticationProvider는 UserDetailsService에서 반환된 UserDetails와 클라이언트가 제공한 token을 대조. 이 과정에서 사용자의 자격 증명이 유효한지 확인.
8. 사용자가 유효하다고 판단되면, 인증 정보는 SecurityContext에 저장됨. 인증된 사용자의 정보를 보관하는 곳.
9. 이렇게 인증 과정을 거치면, 사용자는 시스템에 안전하게 인증된 것으로 간주.
10. 인증 완료 후, 사용자의 요청은 접근 제어 및 권한 부여 과정을 거쳐 처리됨.
