본문 바로가기

Spring Security2

WebSecurity.ignoring()을 알아보자 백선장님 인강에서 보면 ignoring 하는 방법과 ignoring 된 요청은 시큐리티 필터 목록 (Filters) 갯수가 "0"임을 확인할 수 있었다. ignoring() 내부와 어떻게 필터 목록이 0개가 되는지 살펴보고 싶어졌다. # ignoring() 정적인 요청은 시큐리티 설정에서 WebSecurity.ignoring()을 이용하여 필터 적용을 제외할 수 있다. ignoring()외에 다른 방법들도 존재하는데, 어떤 것들이 있는지 살펴보자. # 요청 제외 방법 사진에 나와있는 WebSecurity.ignoring()이 제공해주는 제외 방법이 requestMatchers 외에도 다른 방법들이 존재하는데, ignoring 내부를 들어가보면 다음과 같다. IgnoredRequestConfigurer 를.. 2021. 5. 30.
SecurityContext 와 Authentication 내부 속으로 이전 포스팅에서는 SecurityContext를 가지고 있는 SecurityContextHolder 내부를 살펴보았다. 이번에는 SecurityContext와 Authentication의 내부를 살펴보자. # SecurityContext javadoc에 설명된 내용을 해석해보자. 현재 실행 중인 쓰레드와 연관된 최소한의 보안 정보를 정의하는 인터페이스이다. SecurityContext는 SecurityContextHolder에 저장된다. SecurityContext를 구현한 구현체는 SecurityContextImpl 하나밖에 없다. (SecurityContextImpl 내부를 보면 Authentication을 가지고 있는 것 외에는 크게 중요한 게 없다.) 다음으로 Authentication 내부를 살.. 2021. 5. 17.