If you're already a student of Learn Spring Security, you can get started diving deeper into registration with Module 2 If you're not yet a student, you can get access to the course here: https://bit.ly/github-lss
mvn clean install
This is a Spring Boot project, so you can deploy it by simply using the main class: Application.java
Once deployed, you can access the app at:
By default, the project is configured to use the embedded H2 database. If you want to use the MySQL instead, you need to uncomment relevant section in the application.properties and create the db user as shown below:
mysql -u root -p
> CREATE USER 'tutorialuser'@'localhost' IDENTIFIED BY 'tutorialmy5ql';
> GRANT ALL PRIVILEGES ON *.* TO 'tutorialuser'@'localhost';
> FLUSH PRIVILEGES;
You need to configure the email by providing your own username and password in application.properties You also need to use your own host, you can use Amazon or Google for example.
If you want to activate the configuration for the article Custom Login Page for Returning User, then you need to comment the @Component("myAuthenticationSuccessHandler") annotation in the MySimpleUrlAuthenticationSuccessHandler and uncomment the same in MyCustomLoginAuthenticationSuccessHandler.
The geolocation checks do not work for the IP addresses 127.0.0.1 and 0.0.0.0,
which can be a problem when running the application locally or in a test environment.
To enable/disable the check on the geolocation, set the property geo.ip.lib.enabled
to true/false; this is false by default.