커스텀 페이지를 한번 만들어 보자.

http.formLogin()
				.loginPage("/login");

컨트롤러

@Controller
public class LoginOutController {

	@GetMapping("/login")
	public String loginForm() {
		return "login";
	}

	@GetMapping("/logout")
	public String logoutForm() {
		return "logout";
	}
}

/templates/login.html

<!DOCTYPE html>
<html lang="en" xmlns:th="<http://www.thymeleaf.org>">
<head>
    <meta charset="UTF-8">
    <title>Login</title>
</head>
<body>
<h1>Login</h1>
<div th:if="${param.error}">
    Invalid username or password
</div>
<form action="/login" method="post" th:action="@{/login}">
    <p>
        <label for="id">id</label>
        <input type="text" id="id" name="username" />
    </p>
    <p>
        <label for="password">password</label>
        <input type="text" id="password" name="password" />
    </p>
    <button>로그인</button>
</form>
</body>
</html>

기본 파라미터 username, password

logout view

<!DOCTYPE html>
<html lang="en" xmlns:th="<http://www.thymeleaf.org>">
<head>
    <meta charset="UTF-8">
    <title>Login</title>
</head>
<body>
<h1>Logout</h1>
<form action="/logout" method="post" th:action="@{/logout}">
    <button>로그아웃</button>
</form>
</body>
</html>