loadUserByUsername is the single UserDetailsService operation that receives a username and retrieves the matching User for authentication. A repository-backed implementation delegates to findByUsername(); it must return a user or throw UsernameNotFoundException, never null. section 5.2.2
Repository-backed lookup
Define UserRepository with findByUsername(String username), then expose a UserDetailsService bean. Its lambda passes the supplied username to the repository, returns the matching User, and throws UsernameNotFoundException when no user exists.
