Spring Security Framework

org.springframework.security.userdetails
Class UserDetailsByNameServiceWrapper

java.lang.Object
  extended by org.springframework.security.userdetails.UserDetailsByNameServiceWrapper
All Implemented Interfaces:
InitializingBean, AuthenticationUserDetailsService

public class UserDetailsByNameServiceWrapper
extends Object
implements AuthenticationUserDetailsService, InitializingBean

This implementation for AuthenticationUserDetailsService wraps a regular Spring Security UserDetailsService implementation, to retrieve a UserDetails object based on the user name contained in a PreAuthenticatedAuthenticationToken.

Since:
2.0
Author:
Ruud Senden

Constructor Summary
UserDetailsByNameServiceWrapper()
           
 
Method Summary
 void afterPropertiesSet()
          Check whether all required properties have been set.
 UserDetails loadUserDetails(Authentication authentication)
          Get the UserDetails object from the wrapped UserDetailsService implementation
 void setUserDetailsService(UserDetailsService aUserDetailsService)
          Set the wrapped UserDetailsService implementation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserDetailsByNameServiceWrapper

public UserDetailsByNameServiceWrapper()
Method Detail

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Check whether all required properties have been set.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception
See Also:
InitializingBean.afterPropertiesSet()

loadUserDetails

public UserDetails loadUserDetails(Authentication authentication)
                            throws UsernameNotFoundException,
                                   DataAccessException
Get the UserDetails object from the wrapped UserDetailsService implementation

Specified by:
loadUserDetails in interface AuthenticationUserDetailsService
Parameters:
authentication - The pre-authenticated authentication token
Returns:
UserDetails for the given authentication token, never null.
Throws:
UsernameNotFoundException - if no user details can be found for the given authentication token
DataAccessException

setUserDetailsService

public void setUserDetailsService(UserDetailsService aUserDetailsService)
Set the wrapped UserDetailsService implementation

Parameters:
aUserDetailsService - The wrapped UserDetailsService to set

Spring Security Framework

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