ApiUserDetailsService.java 文件源码

java
阅读 24 收藏 0 点赞 0 评论 0

项目:artsholland-platform 作者:
@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;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号