inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

묻고 답해요

173만명의 커뮤니티!! 함께 토론해봐요.

@AuthenticationPrincipal null 현상 해결이 되지 않습니다 .. ㅠㅠ

미해결

Filter 처리 후 SecurityContextHolder에 주입 그 후 컨트롤러에서 @AuthenticationPrincipal 로 가져올 시 null 현상이 일어납니다. 컨트롤러 단에서 SecurityContextHolder 에서 꺼내서 Principal 가져올 시 존재하는데 어노테이션을 통하여 사용하려고 하니 null 이 뜨네요.. 혹시 무언가 잘못된 부분이 있을까요 ..? Security 인증은 따로 사용하지 않고 있습니다. Spring Cloud Gateway ->모듈 Fileter -> Controller 로 사용중입니다. SCG에서 토큰 검증 후 uid를 모듈로 넘겨준 후 공통으로 사용하기 위해 AuthenticationPrincipal를 사용하려 합니다. FIlter TokenProvider Test Controller User Entity UserDetails Override

  • springsecurity
  • customfilter
  • SecurityContext
  • authentication
  • principal
호띠 댓글 1 좋아요 0 조회수 1274

인기 태그

인프런 TOP Writers

주간 인기글