Security With Spring Boot
Spring Boot Security provides you with a basic, self-configuring security layer by simply including the following dependency on your pom.xml.
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>Spring-boot-starter-security</artifactId> </dependency>
How does it work?
Once Spring Boot imports the dependency libraries, it puts a layer between view and controller forcing you to only allow access if you are logged in.
Even if you do not have a Spring Boot Security login form, spring boot will provide you with one and show it as a login page with the user and password inputs as shown in the following image.
By default the user is ‘ user ‘ and the generated password will be on your console.
Once you are logged-in correctly you will be able to navigate your application freely. Of course this is useless in a real world application so in the following post we will create our personalized login page with thymeleaf and connect the application to a database to save our users and roles in this.
In the video you can see step by step this tutorial, do not forget to leave your comments and share.
Thank you