min429 / english-conversation-server

영어 회화 앱 토이프로젝트 - 서버
Apache License 2.0
0 stars 0 forks source link

AuthenticationException 예외를 잡지 못하는 문제 #19

Open min429 opened 3 months ago

min429 commented 3 months ago

목적

AuthenticationException 예외를 잡지 못하는 문제 해결

작업 상세 내용

  • [ ] JwtAuthenticationFilter에서 던지는 AuthenticationException 예외를 JwtAuthenticationEntryPoint에서 잡지 못하는 문제
  • [ ] Internal Server Error, 상태코드 500 응답
min429 commented 3 months ago

SpringSecurity FilterChain에 등록된 Filter들 중 내가 등록한 JwtAuthenticaionFilter에서 예외가 발생하면 다음 필터로 넘어가지 않고 WAS까지 예외가 전달되는 것 같음. 그래서 JwtAuthenticationFilter에서 직접 JwtAuthenticationEntryPoint 예외처리를 실행시킴으로써 일단 문제 해결. JwtAuthenticationFilter에서 try-catch로 직접 예외를 핸들링하지 않고 예외를 처리할 수 있는지는 아직 잘 모르겠다.