728x90
개발자 유미 | 커뮤니티
www.devyummi.com
프로젝트 생성
필수 의존성
- Spring Web
- Lombok
- Mustache
- Spring Security
- Spring Data JPA
- MySQL Driver
MainController.java 생성
/controller/MainController.java
package com.example.testsecurity.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
@Controller
public class MainController {
@GetMapping("/")
public String mainP() {
return "main";
}
}
main.mustache 생성
/templates/main.mustache
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Main Page</title>
</head>
<body>
main page
</body>
</html>
스프링 시큐리티 기본값
스프링 시큐리티 활성화 후 기본값이 적용되어 모든 경로에 대한 인증을 요구함.
기본 인증 정보
- Username : user
- Password : 콘솔 창의 security password 참고
728x90
'Spring > Spring Security' 카테고리의 다른 글
개발자 유미 - 스프링 시큐리티 3. Security Config 인가 작업 (0) | 2025.02.09 |
---|---|
개발자 유미 - 스프링 시큐리티 1 : 실습 목표 및 간단한 동작 원리 (0) | 2025.02.05 |