Package org.springframework.security.core.userdetails

# Interface UserDetailsService

All Known Subinterfaces:
  `UserDetailsManager`

All Known Implementing Classes:
  `CachingUserDetailsService`, `InMemoryUserDetailsManager`, `JdbcDaoImpl`, `JdbcUserDetailsManager`

public interface UserDetailsService
Core interface which loads user-specific data.

It is used throughout the framework as a user DAO and is the strategy used by the `DaoAuthenticationProvider`.

The interface requires only one read-only method, which simplifies support for new data-access strategies.

See Also:
  - `DaoAuthenticationProvider`
  - `UserDetails`

## Method Summary

Modifier and Type
Method
Description
`UserDetails`
`loadUserByUsername(String username)`
Locates the user based on the username.

## Method Details

### loadUserByUsername

UserDetails loadUserByUsername(String username) throws UsernameNotFoundException
Locates the user based on the username. In the actual implementation, the search may possibly be case sensitive, or case insensitive depending on how the implementation instance is configured. In this case, the `UserDetails` object that comes back may have a username that is of a different case than what was actually requested..

Parameters:
  `username` - the username identifying the user whose data is required.
Returns:
  a fully populated user record (never `null`)
Throws:
  `UsernameNotFoundException` - if the user could not be found or the user has no GrantedAuthority