Concept Flow - UserDetailsService implementation
Start Authentication
Call loadUserByUsername(username)
Search user in database
Create UserDetails
Return UserDetails
Spring Security uses UserDetails for auth
End
The flow starts with Spring Security calling loadUserByUsername. The method searches the database for the user. If found, it creates and returns a UserDetails object. If not, it throws an exception.