티스토리 뷰

Spring Security

AuthenticationEntryPoint에 관해

VIRGIL ABLOH 2023. 1. 4. 01:45
반응형

먼저 본인 프로젝트의 문제가 header에 JWT가 포함되어야하는 API에서 header가 없을때 exception을 발생시켜야 한다.

security config 쪽에 AuthenticationEntryPoint의 구현체로 설정해준다.

그후 인증되지 않은 사용자가 접근시 예외를 뱉어내게 한다.

추가적인 설명으로 해당 내용은 AuthenticationEntryPoint에서  ExceptionTranslationFilter의 설명이다.

빨간줄내용으로는 모든 AccessDeniedException(입장불가예외) 및  AuthenticationException(인증예외) 발생시 예외처리를 filter chain으로 처리한다고 기재되어 있다.

 

참조: https://mighty96.github.io/til/access-authentication/

반응형

'Spring Security' 카테고리의 다른 글

Spring Security-Exception 처리에 관해  (0) 2022.12.28
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG
more
«   2026/06   »
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
글 보관함