首页 > 其他 > 详细

SimpleAuthenticationInfo

时间:2019-04-11 20:57:16      阅读:485      评论:0      收藏:0      [点我收藏+]
 public SimpleAuthenticationInfo(Object principal, Object hashedCredentials, ByteSource credentialsSalt, String realmName) {
        this.principals = new SimplePrincipalCollection(principal, realmName);
        this.credentials = hashedCredentials;
        this.credentialsSalt = credentialsSalt;
    }

realm中使用这个构造方法时,第一个参数principal传入的值和subject.getPrincipal()获取的值一致。

这里传入userEntity(实体),subject.getPrincipal()得到的是userEntity(实体);

这里传入username(字符串),subject.getPrincipal()得到的是字符串。

SimpleAuthenticationInfo

原文:https://www.cnblogs.com/a-s-m/p/10692303.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!