diff options
| author | Kamal Wickramanayake <kamal@inbox.lk> | 2026-06-13 21:03:31 +0530 |
|---|---|---|
| committer | Kamal Wickramanayake <kamal@inbox.lk> | 2026-06-13 21:03:31 +0530 |
| commit | f0001c5c8d8a33729b93d8d6e10d3af40bfabed6 (patch) | |
| tree | 6042e5bfdd48671daa95baf29c5041e526f5b62e /spring-boot/09-spring-security-db-authentication/README | |
| parent | 6ae21cd4e51756ea14b43b82a9d500bca9fb8032 (diff) | |
Added sample application 09-spring-security-db-authentication
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 |
