[트러블 슈팅] Authentication Principal is not of type CustomUserDetails. Actual type: java.long.String
·
Spring/Error
💬 들어가기앞서 . . .이 문제는 Spring Security를 활용하여 JWT 인증을 구현하는 과정에서 발생했습니다.로그를 확인하며 디버깅한 결과, Custom한 UserDetails 객체의 특정 필드가 예상한 타입이 아닌 String 타입으로 반환되면서 문제가 발생한 것을 확인할 수 있었습니다. 유사한 문제가 발생하지 않도록 발생한 오류의 원인과 해결 방법을 단계별로 정리하겠습니다.🛠️ [트러블슈팅] Authentication Principal is not of type CustomUserDetails.1. 문제 상황 (Issue)[Authentication Principal is not of type CustomUserDetails. Actual type: java.lang.String] 사용..