TIL_230404

2023. 4. 5. 01:55TIL_WIL

시큐리티 filter를 걸어주는 과정에서 여러 방법이 있는 것을 확인했다.

접근 권한에 대한 설정은 exceptionHandling을 사용해도 되고

http.exceptionHandling()

.authenticationEntryPoint(new RestAuthenticationEntryPoint())

.accessDeniedHandler(tokenAccessDeniedHandler);

jwt 필터 이전에 custom하여 걸어줘도 된다.

.addFilterBefore(new JwtAuthFilter(jwtUtil), UsernamePasswordAuthenticationFilter.class)

.addFilterBefore(jwtExceptionFilter, JwtAuthFilter.class);



token 만료시에 내뱉는 http status를 custom 하는 로직을 짜는데서 어려움을 겪고있다. filter에 대한 공부를 조금 더 해봐야겠다.

'TIL_WIL' 카테고리의 다른 글

TIL_230407  (0) 2023.04.08
TIL_230406  (0) 2023.04.07
TIL_230403  (0) 2023.04.04
WIL_230402  (0) 2023.04.02
TIL_230401  (0) 2023.04.02