Interface SwitchUserDetailsService

All Known Implementing Classes:
DelegateUserDetailsServiceSwitchUserDetailsService

public interface SwitchUserDetailsService
Similar to UserDetailsService with the difference that this passes the current authentication of the user performing the impersonation.
Author:
Filip Hrisafov
See Also:
  • Method Details

    • loadUserByUsername

      UserDetails loadUserByUsername(Authentication currentAuthentication, String username) throws UsernameNotFoundException
      Locates the user based on the username.
      Parameters:
      currentAuthentication - the authentication of the user performing the impersonation
      username - the username that should be impersonated
      Returns:
      a fully populated user record (never null)
      Throws:
      UsernameNotFoundException - if ther could not be found