Spring/Security 3

스프링 시큐리티 - 3

세션 제어 필터 SessionManagementFilter 세션 관리 인증 시 사용자의 세션정보를 등록, 조회, 삭제 등의 세션 이력을 관리 동시적 세션 제어 동일 계정으로 접속이 허용되는 최대 세션 수를 제한 세션 고정 보호 인증 할 때마다 세션 쿠키를 새로 발급하여 공격자의 쿠키 조작을 방지 세션 생성 정책 Always, If_Required, Never, Statless ConcurrentSessionfilter 매 요청 마다 현재 사용자의 세션 만료 여부 체크 세션이 만료되었을 경우 즉시 만료 처리 session.isExpired() == true 로그아웃 즉지 오류 페이지 응답 ConcurrentSessionControlAuthenticationStrategy : 동시적 세션제어 담당. 최대세션..

Spring/Security 2022.12.07

스프링 시큐리티 - 2

익명사용자 인증 필터 AnonymousAuthenticationFilter SecurityContext에 인증객체(Authentication)가 존재하는지 아닌지 파악한다 인증객체가 존재하지않는다면 익명의 사용자로 파악하여 익명사용자용 인증객채(AnonymousAuthenticationToken)를 생성하여 토큰 발급 SecurityContext에 저장 인증사용자와 익명사용자를 구분해서 처리하기위한 용도 회원 인증여부를 구현할때 isAnonymous()와 isAuthenticated()로 구분해서 사용. 동시 세션 제어 최대 세션 허용 개수 초과했을때 1. 이전 사용자 세션 만료 sequenceDiagram autonumber actor U1 as 사용자 1 actor U2 as 사용자 2 partici..

Spring/Security 2022.12.05

스프링 시큐리티 - 1

FormLogin 인증 필터 graph TB A((user)) --> |Request| B[UsernamePasswordAuthenticationFilter] -->|요청정보가 매칭되는지 확인| C{AntPathRequestMatcher} --> |NO| D[chain.doFilter] C{AntPathRequestMatcher} --> |YES| E[Authentication] --> |인증| F{AuthenticationManager} --> |위임| G[AuthenticationProvider] --> |인증성공| F G --> |인증실패| H[AuthenticationException] --> B F --> I[Authentication] --> J[SecurityContext] UsernameP..

Spring/Security 2022.12.02