[SpringBoot] 스프링부트 프로젝트 시작하기 - 6. 토큰 이용하여 인가된 사용자 걸러내기
·
Spring
버전SpringBoot 3.3.0Java 17JWT 0.12.5목표토큰을 통해 인가된 사용자 구분하기Deprecated 된 함수 사용하지 않기구현이전 포스팅에서 로그인 시 토큰을 발행하는 부분까지 구현을 했다. 이번 포스팅에서는 해당 토큰을 이용하여 회원정보 요청을 보내고, 인가된 사람에게만 정보를 반환하는 부분을 구현해본다.MemberInfoResponsepackage com.study.springStarter.member.controller.response;import com.study.springStarter.member.entity.Member;import lombok.Data;@Datapublic class MemberInfoResponse { private String loginId; ..
[SpringBoot] 스프링부트 프로젝트 시작하기 - 5. Security 설정하고 로그인 확인하기
·
Spring
버전SpringBoot 3.3.0Java 17JWT 0.12.5목표SpringSecurity + JWT 적용하기토큰을 통해 인가된 사용자 구분하기Deprecated 된 함수 사용하지 않기구현SecuriryConfigpackage com.study.springStarter.common.authority;import lombok.RequiredArgsConstructor;import org.springframework.context.annotation.Bean;import org.springframework.context.annotation.Configuration;import org.springframework.security.config.annotation.web.builders.HttpSecurity;..