Class LdapUserDetailsService
- java.lang.Object
-
- org.springframework.security.ldap.userdetails.LdapUserDetailsService
-
- All Implemented Interfaces:
UserDetailsService
public class LdapUserDetailsService extends java.lang.Object implements UserDetailsService
LDAP implementation of UserDetailsService based around anLdapUserSearchand anLdapAuthoritiesPopulator. The final UserDetails object returned from loadUserByUsername is created by the configured UserDetailsContextMapper.
-
-
Constructor Summary
Constructors Constructor Description LdapUserDetailsService(LdapUserSearch userSearch)LdapUserDetailsService(LdapUserSearch userSearch, LdapAuthoritiesPopulator authoritiesPopulator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description UserDetailsloadUserByUsername(java.lang.String username)Locates the user based on the username.voidsetUserDetailsMapper(UserDetailsContextMapper userDetailsMapper)
-
-
-
Constructor Detail
-
LdapUserDetailsService
public LdapUserDetailsService(LdapUserSearch userSearch)
-
LdapUserDetailsService
public LdapUserDetailsService(LdapUserSearch userSearch, LdapAuthoritiesPopulator authoritiesPopulator)
-
-
Method Detail
-
loadUserByUsername
public UserDetails loadUserByUsername(java.lang.String username) throws UsernameNotFoundException
Description copied from interface:UserDetailsServiceLocates 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, theUserDetailsobject that comes back may have a username that is of a different case than what was actually requested..- Specified by:
loadUserByUsernamein interfaceUserDetailsService- 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
-
setUserDetailsMapper
public void setUserDetailsMapper(UserDetailsContextMapper userDetailsMapper)
-
-