본문 바로가기

로그아웃3

[쇼핑몰] 로그인/로그아웃 구현하기 - 3 thymeleaf-extras-springsecurity5 라이브러리를 사용하면 권한에 따라 메뉴 노출할 수 있게 도와준다. org.thymeleaf.extras thymeleaf-extras-springsecurity5 header.html Shop 상품 등록 상품 관리 장바구니 구매이력 로그인 로그아웃 Search 2023. 7. 11.
[쇼핑몰] 로그인/로그아웃 구현하기 - 2 화면을 이용하지 않고 Spring Security를 테스트하는 방법 spring-security-test의존성을 pom.xml에 추가 org.springframework.security spring-security-test 5.7.5 MemberControllerTest.java package com.shop.controller; import com.shop.dto.MemberFormDto; import com.shop.entity.Member; import com.shop.service.MemberService; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.springframework.bea.. 2023. 7. 10.
[쇼핑몰] 로그인/로그아웃 구현하기 - 1 UserDetailService - UserDetailService 인터페이스는 데이터베이스에서 회원 정보를 가져오는 역할 - loadUserByUsername()메소드가 존재하며, 회원정보를 조회하여 사용자의 정보와 권한을 갖는 UserDetail인터페이스를 반환 - 스프링 시큐리티에서 UserDetailService를 구현하고 있는 클래스를 통해 로그인 기능을 구현 UserDetail - 스프링 시큐리티에서 회원의 정보를 담기 위해서 사용하는 인터페이스 UserDetails - 이 인터페이스를 직접 구현 하거나 스프링 시큐리티에서 제공하는 User클래스를 사용 - User클래스는 UserDetails 인터페이스를 구현하고 있는 클래스 ​ 로그인/로그아웃 구현하기 - 로그인 기능 구현을 위해 기존에 만.. 2023. 7. 7.