Spring Boot Form Security Example - Creating a custom Login Page
It made use of the default Spring Login Page. In this tutorial we will adding our own custom login web page. On log out we will be directed to this login page with some logout message.
Spring Boot Security - Table Of Contents
Spring Boot + Simple Security Configuration Spring Boot Form Security Login Hello World Example Spring Boot Security - Custom Login Page Example Spring Boot Security - JDBC Authentication Example Spring Boot Security - Creating Users Programmatically Using JdbcUserDetailsManager Spring Boot Security - Password Encoding Using Bcrypt Spring Boot Security - Enabling CSRF Protection Spring Boot Security - Authentication Handler Example Spring Boot Security - Introduction to OAuth Spring Boot OAuth2 Part 1 - Getting The Authorization Code Spring Boot OAuth2 Part 2 - Getting The Access Token And Using it to Fetch Data.
Video
This tutorial is explained in the below Youtube Video.Lets Begin-
Maven Project will be as follows-

The Custom login page login.jsp is as follows-
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> <c:set var="contextPath" value=""/> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags --> <meta name="description" content=""> <meta name="author" content=""> <title>Log in with your credentials</title> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> </head> <body> <div class="container"> <form method="POST" action="/login" class="form-signin"> <h2 class="form-heading">Log in</h2> <div class="form-group "> <span></span> <input name="username" type="text" class="form-control" placeholder="Username" autofocus="true"/> <input name="password" type="password" class="form-control" placeholder="Password"/> <span></span> <button class="btn btn-lg btn-primary btn-block" type="submit">Log In</button> </div> </form> </div> <!-- /container --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script></body> </html>