Class UserDetailsServiceImpl
java.lang.Object
com.foreach.across.modules.user.security.UserDetailsServiceImpl
- All Implemented Interfaces:
org.springframework.security.core.userdetails.UserDetailsService
@Service
public class UserDetailsServiceImpl
extends Object
implements org.springframework.security.core.userdetails.UserDetailsService
Implementation of
UserDetailsService
that dispatches lookups to a backing SecurityPrincipalService
.
A lookup by username will loop through all active user directories (UserDirectoryService.getActiveUserDirectories()
and build a unique principal name for that particular directory. The first non-null UserDetails
implementation
returned from the SecurityPrincipalService
will be returned.
In case of several directories this lookup will incur a performance hit, adequate caching is advised.
-
Constructor Summary
ConstructorDescriptionUserDetailsServiceImpl
(com.foreach.across.modules.spring.security.infrastructure.services.SecurityPrincipalService securityPrincipalService, UserDirectoryService userDirectoryService) -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.security.core.userdetails.UserDetails
loadUserByUsername
(String username)
-
Constructor Details
-
UserDetailsServiceImpl
@Autowired public UserDetailsServiceImpl(com.foreach.across.modules.spring.security.infrastructure.services.SecurityPrincipalService securityPrincipalService, UserDirectoryService userDirectoryService)
-
-
Method Details
-
loadUserByUsername
public org.springframework.security.core.userdetails.UserDetails loadUserByUsername(String username) throws org.springframework.security.core.userdetails.UsernameNotFoundException - Specified by:
loadUserByUsername
in interfaceorg.springframework.security.core.userdetails.UserDetailsService
- Throws:
org.springframework.security.core.userdetails.UsernameNotFoundException
-