本文整理汇总了Java中org.springframework.security.authentication.AccountStatusUserDetailsChecker类的典型用法代码示例。如果您正苦于以下问题:Java AccountStatusUserDetailsChecker类的具体用法?Java AccountStatusUserDetailsChecker怎么用?Java AccountStatusUserDetailsChecker使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AccountStatusUserDetailsChecker类属于org.springframework.security.authentication包,在下文中一共展示了AccountStatusUserDetailsChecker类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: UserServiceImpl
import org.springframework.security.authentication.AccountStatusUserDetailsChecker; //导入依赖的package包/类
@Autowired
public UserServiceImpl(UserRepository userRepository, EMailService eMailService,
PasswordEncoder encoder, BoardRepository boardRepository,
TaskRepository taskRepository, SecureRandom random) {
Assert.notNull(userRepository, "User repository null");
Assert.notNull(eMailService, "EMail service null");
Assert.notNull(encoder, "password encoder null");
Assert.notNull(boardRepository, "boardRepository null");
Assert.notNull(taskRepository, "taskRepository null");
Assert.notNull(random, "SecureRandom null");
this.userRepository = userRepository;
this.eMailService = eMailService;
this.encoder = encoder;
this.boardRepository = boardRepository;
this.taskRepository = taskRepository;
this.random = random;
detailsChecker = new AccountStatusUserDetailsChecker();
}
示例2: loadUserByUsername
import org.springframework.security.authentication.AccountStatusUserDetailsChecker; //导入依赖的package包/类
@Override
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
final Optional<UserAccount> user = userRepository.findOneByUsername(username);
final AccountStatusUserDetailsChecker detailsChecker = new AccountStatusUserDetailsChecker();
user.ifPresent(detailsChecker::check);
return user.orElseThrow(() -> new UsernameNotFoundException("user not found."));
}
示例3: loadUserByUsername
import org.springframework.security.authentication.AccountStatusUserDetailsChecker; //导入依赖的package包/类
@Override
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
final Optional<User> user = userRepository.findOneByUsername(username);
final AccountStatusUserDetailsChecker detailsChecker = new AccountStatusUserDetailsChecker();
user.ifPresent(detailsChecker::check);
return user.orElseThrow(() -> new UsernameNotFoundException("user not found."));
}