Notice
Recent Posts
Recent Comments
Link
«   2024/07   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
Tags
more
Archives
Today
Total
관리 메뉴

개발새발

#spring security 본문

스프링

#spring security

개발하는후추 2022. 8. 5. 09:41
spring security란 spring기반의 
애플리케이션의 보안(인증, 인가, 권한등)을 담당하는 스프링 하위 프레임워크
  • '인증', '권한'에 대한 부분을 Filter 흐름에 따라 처리
  • Filter는 Dispatcher Servlert로 가기전에 적용되므로 가장 먼저 URL요청을 받음

  1. 사용자가 Username과 Password를 통해 인증을 요청
  2. AuthenticationFilter의 구현체인 UsernamePasswordAuthenticationFilter는 전달받은 Username과 Password를 가지고 UsernamePasswordAuthenticationToken을 생성
  3. 생성된 Authentication을 AuthenticationManager에 전달
  4. AuthenticationManager는 전달받은 Authentication을 다수의 AuthenticationProvider에 전달하여 유효성 검증 및 처리를 위임
  5. 입력받은 사용자의 인증 정보의 유효성 검증을 위해 UserDetailsService로 전달
  6. UserDetailsService는 loadUserByUsername() 메소드를 통해 사용자 정보를 조회하여 실제 존재하는 사용자인지, Username과 Password가 유효한지 검증
  7. 만약 6에서 사용자의 인증 정보 검증이 성공적으로 이루어졌다면 해당 사용자 정보를 활용해 UserDetails를 생성
  8. 생성된 UserDetails를 AuthenticationProvider에 전달
  9. authenticate() 메소드가 호출되며 UserDetails와 Authorities로 생성한 Authentication을 전달
  10. 생성된 Authentication을 AuthenticationFilter에 전달
  11. AuthenticationFilter는 인증 처리가 모두 완료되어 해당 사용자의 인증 정보를 담고 있는 Authentication을 SecurityContext에 저장

참조 : https://mangkyu.tistory.com/76

'스프링' 카테고리의 다른 글

Spring MVC 예외처리 기법  (0) 2022.10.26
서블릿(Servlet)  (0) 2022.09.11
트랜잭션이란?  (0) 2022.08.04
ORM이란?  (0) 2022.08.04
# REST Client  (0) 2022.08.04
Comments