Spring Security and UserDetailsService

I am new to Spring Security and I am trying to implement custom UserDetailsServicefor authentication. My concern is that this interface contains only one method loadUserByUsername(String username)that takes only the username as a parameter and returns UserDetails.

I was wondering why this method does not accept a password as a parameter.

How did Spring manage to authenticate a user based only on username?

I am new to Spring Security and any clarification in Api and the authentication process in Spring Security is welcome.

+4
source share
1 answer

UserDetailsService. AuthenticationProvider.

, DaoAuthenticationProvider UserDetailsService , UsernamePasswordAuthenticationToken , , .

DaoAuthenticationProvider, , .

+6

All Articles