@Override
public UserDetails loadUserByUsername(String apiKey)
throws UsernameNotFoundException {
String userPropsValue = userProperties.getProperty(apiKey);
if (userPropsValue == null) {
throw new UsernameNotFoundException(apiKey);
}
UserAttributeEditor configAttribEd = new UserAttributeEditor();
configAttribEd.setAsText(userPropsValue);
UserAttribute userAttributes = (UserAttribute) configAttribEd.getValue();
UserDetails user = new User(apiKey,
userAttributes.getPassword(),
userAttributes.isEnabled(),
true,
true,
true,
userAttributes.getAuthorities());
return user;
}
ApiUserDetailsService.java 文件源码
java
阅读 24
收藏 0
点赞 0
评论 0
项目:artsholland-platform
作者:
评论列表
文章目录