org.springframework.security.ldap.userdetails
Class LdapUserDetailsService

java.lang.Object
  extended by org.springframework.security.ldap.userdetails.LdapUserDetailsService
All Implemented Interfaces:
UserDetailsService

public class LdapUserDetailsService
extends Object
implements UserDetailsService

LDAP implementation of UserDetailsService based around an LdapUserSearch and an LdapAuthoritiesPopulator. The final UserDetails object returned from loadUserByUsername is created by the configured UserDetailsContextMapper.

Version:
$Id: LdapUserDetailsService.java 3853 2009-09-01 16:42:11Z ltaylor $
Author:
Luke Taylor

Constructor Summary
LdapUserDetailsService(LdapUserSearch userSearch)
           
LdapUserDetailsService(LdapUserSearch userSearch, LdapAuthoritiesPopulator authoritiesPopulator)
           
 
Method Summary
 UserDetails loadUserByUsername(String username)
          Locates the user based on the username.
 void setUserDetailsMapper(UserDetailsContextMapper userDetailsMapper)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LdapUserDetailsService

public LdapUserDetailsService(LdapUserSearch userSearch)

LdapUserDetailsService

public LdapUserDetailsService(LdapUserSearch userSearch,
                              LdapAuthoritiesPopulator authoritiesPopulator)
Method Detail

loadUserByUsername

public UserDetails loadUserByUsername(String username)
                               throws UsernameNotFoundException
Description copied from interface: UserDetailsService
Locates the user based on the username. In the actual implementation, the search may possibly be case insensitive, 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..

Specified by:
loadUserByUsername in interface UserDetailsService
Parameters:
username - the username presented to the DaoAuthenticationProvider
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)


Copyright © 2004-2009 SpringSource, Inc. All Rights Reserved.