문제
Spring boot 2.4.5로 업그레이드 한 뒤 authentication 값이 null이다.
@GetMapping("/api/users/me")
public UserResponse getMe(@AuthenticationPrincipal Authentication authentication) {
// ...
// ...
}
해결
PrincipalMethodArgumentResolver를 추가해도 되지만
그냥 @AuthenticationPrincipal
annotation을 제거하면 된다.
스프링에서 문서 수정하는걸 깜빡 했나보다.
'개발 > Java,Spring' 카테고리의 다른 글
Spring boot 2.4.5 @AuthenticationPrincipal occurs null (0) | 2021.04.30 |
---|---|
우아한 테크세미나 - 스프링 배치 (3) | 2019.09.27 |
SpringSecurity에서 anonymous() (2) | 2019.08.15 |
Spring Boot 2.x Security에서 hasPermission 사용 (0) | 2019.08.11 |
SpringBoot Batch에서 JobParameter로 받을 수 있는 Type (4) | 2019.05.17 |