diff options
Diffstat (limited to 'spring-boot/09-spring-security-db-authentication/README')
| -rw-r--r-- | spring-boot/09-spring-security-db-authentication/README | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/spring-boot/09-spring-security-db-authentication/README b/spring-boot/09-spring-security-db-authentication/README new file mode 100644 index 0000000..6e50354 --- /dev/null +++ b/spring-boot/09-spring-security-db-authentication/README @@ -0,0 +1,23 @@ +This sample project shows how to authenticate users based on credentials maintained in a Postgresql database. + +Passwords are hashed using Argon2. Look at the SecurityConfig.java for Argon2 input parameters used. + +To run with support for hot swap during development, use the dev profile as follows: + + mvn spring-boot:run -Dspring-boot.run.profiles=dev + +User/Pasword (as defined in resources/data.sql) + + admin: abc123 + user1: abc123 + +Key points: + +1. pom.xml dependencies +2. config/SecurityConfig.java - Can be used to modify Spring Security behavior. +3. user package Java source files + - serivice/CustomUserDetailsService.java is the key source file that defines a UserDetailsService bean that fetches user details from UserRepository (which fetches data from database using JPA) + +Misc: + +Online Argon2 hash generator: https://argon2.online/
\ No newline at end of file |
