본문 바로가기

solyrion

검색하기
solyrion
프로필사진 ert1015

  • 분류 전체보기 (31)
    • 알고리즘 (6)
    • Spring MVC (6)
    • Spring DB (9)
    • Spring (1)
    • Redis (5)
    • AWS (1)
    • DevOps (3)
Guestbook
Notice
Recent Posts
Recent Comments
Link
«   2026/01   »
일 월 화 수 목 금 토
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 31
Tags
  • cluster
  • LeetCode
  • 트래픽
  • 무중단 배포
  • github actions
  • DevOps
  • TTL
  • 알고리즘
  • docker
  • memcached
  • Python
  • spring security
  • 백준
  • 1174
  • 모니터링
  • ci/cd
  • BaekJoon
  • cache
  • Redis
  • 파이썬
  • spring
  • 로깅
more
Archives
Today
Total
관리 메뉴
  • 글쓰기
  • 방명록
  • RSS
  • 관리

목록Spring (1)

solyrion

[Spring Security] CustomUserDetails

스프링 시큐리티를 사용해서 로그인을 구현했다면, 실제 Controller나 Service 계층에서 로그인 한 Member의 정보를 활용해야 합니다.사용자 로그인- Spring Security가 UserDetailsService의 loadUserByUsername(username)을 호출하여 UserDetails 객체를 가져옴.- 해당 UserDetails 객체는 SecurityContext에 저장됨.- 이후 @AuthenticationPrincipal을 사용하면, 현재 로그인한 사용자의 UserDetails 객체를 가져올 수 있음. 따라서 저는 처음에 아래와 같이 코드를 작성했습니다.@PatchMapping("/{postId}")public void updatePost(@PathVariable Long ..

Spring 2025. 2. 6. 20:27
Prev 1 Next

Blog is powered by kakao / Designed by Tistory

티스토리툴바