SpringBoot Security examples for both In-Memory setup and Database Setup

These examples include both Springboot-Security examples using in-memory setup and database setup. See our GitHub code examples using the following link:

View and download the project

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:

loginpage

Invalid Input page:

invalidinput

With Role Employee and Admin page:

emaployeeandadmin

With Role Employee and Hr-Manager page:

emaployeeandadmin

With Role Employee and Manager page:

withRoleEmployeeAndManager

Logout page:

logoutpage

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.