@Autowired
public void registerGlobalAuthentication(AuthenticationManagerBuilder auth) throws Exception {
LOG.info("Registering global user details service");
auth.userDetailsService(username -> {
try {
BillingUser user = billingDao.loadUser(username);
return new User(
user.getUsername(),
user.getPassword(),
Collections.singletonList(() -> "AUTH")
);
} catch (EmptyResultDataAccessException e) {
LOG.warn("No such user: " + username);
throw new UsernameNotFoundException(username);
}
});
}
SecurityServiceConfiguration.java 文件源码
java
阅读 25
收藏 0
点赞 0
评论 0
项目:JavaRestCalculator
作者:
评论列表
文章目录