Spring/Spring Security6 [Spring Security] SecurityContextHolder 내부구조와 PasswordEncoder 📌 SecurityContextHolder 내부구조 스프링 시큐리티는의 내부구조는 위 사진과 같이 서로 겹겹이 감싸고있다. SecurityContextHolder -> SercurityContext -> Authentication -> Principal -> GrantAuthority 코드로 확인할 수 있음. // SecurityContext에서 현재 사용자의 인증 및 보안 정보를 가져옵니다. SecurityContext securityContext = SecurityContextHolder.getContext(); // 현재 사용자의 인증 정보를 가져옵니다. Authentication authentication = securityContext.getAuthentication(); // 현재 사용자의 주.. 2023. 10. 28. [Spring Security] JWT을 알아보자 Spring Boot JWT Tutorial 1. JWT 소개, 프로젝트 생성 2. Data 설정 추가 3. JWT 코드, Security 설정 추가 4. DTO, Repository, 로그인 5. 회원가입, 권한검증 📌 JWT 소개, 프로젝트 생성 JWT란 JWT는 RFC 7519 웹 표준으로 지정이 되어있고 JSON 객체를 사용해서 토큰 자체에 정보들을 저장하고 있는 Web ToKen이다. JWT는 Header, Payload, Signature 3개의 부분으로 구성되어져 있다. Header : Signature를 해싱하기 위한 알고리즘 정보가 담겨있다. Payload : 서버와 클라이언트가 주고받는, 시스템에서 실제로 사용될 정보에 대한 내용이 담겨있다. Signature : 토큰의 유효성을 검증하.. 2023. 7. 10. 이전 1 2 다음