Spring boot 2.4.5 @AuthenticationPrincipal occurs null
2021. 4. 30. 15:07ㆍ개발 이야기
문제
Spring boot 2.4.5로 업그레이드 한 뒤 authentication 값이 null이다.
@GetMapping("/api/users/me")
public UserResponse getMe(@AuthenticationPrincipal Authentication authentication) {
// ...
// ...
}
해결
PrincipalMethodArgumentResolver를 추가해도 되지만
그냥 @AuthenticationPrincipal
annotation을 제거하면 된다.
스프링에서 문서 수정하는걸 깜빡 했나보다.
'개발 이야기' 카테고리의 다른 글
Nginx logrotate후에 로깅이 안되는 문제 (Nginx not logging after logrotate) (0) | 2022.04.27 |
---|---|
typescript, babel, jest 모듈 환경 구성 (0) | 2022.04.23 |
Vue.js 간단한 플러그인 만들기 (0) | 2020.11.20 |
Elasticsearch 기본 쿼리 (1) | 2020.08.20 |
모던 레거시가 되지 않기 위한 노오오력 (0) | 2020.08.05 |