This project shows a fully functioning Spring Boot application which demonstrates how to build an authentication service in your web application. The application makes use of users in a MySQL database to authenticate and decide whether the request must be allowed or not.
- Create a database and a user using the following commands:
CREATE DATABASE contactsdb;
CREATE USER 'john'@'localhost' identified by 'yourpasswordhere';
GRANT ALL ON contactsdb.* to 'john'@'localhost';
-
Import this project into Eclipse or Visual Studio Code
-
Configure application.properties with the appropriate values
-
Run the DemoApplication from your IDE
-
Access your application at: http://localhost:8080/
-
Login with user admin or user with the credentials (currently hard-coded in DemoApplication.java)