Back to: Java Tutorials
These examples include both Springboot-Security examples using in-memory setup and database setup. See our GitHub code examples using the following link:
For in-memory Spring security setup:
Run the project as a Java project and hit the below URL in your browser:
http://localhost:8888/SpringSecurityInMemorySetup/
Login page:
Invalid Input page:
With Role Employee and Admin page:
With Role Employee and Hr-Manager page:
With Role Employee and Manager page:
Logout page:
For Database-JDBC Spring security setup:
Run the project as a Java project and hit the below URL in your browser:
http://localhost:8889/SpringSecurityInMemorySetup/
Before runing the project, run the sql script springsectest.sql. I have used maria DB. I have several users for testing the security:
user pass
-------------------------------------- mamun mamun111
sourav sourav111
kayum kayum111
sourav sourav111
abraham abraham111
I have used https://www.devglan.com/online-tools/bcrypt-hash-generator to generate Bcrypt encrypted password and saved to the database. Spring security by default uses Bcrypt, so we will be entering plain text as a password in the password field, Spring will generate Bcrypt encrypted password and will match the password with the database’s password.