欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 编程资源 > 综合教程 >内容正文

综合教程

SimpleAuthenticationInfo

发布时间:2023/10/11 综合教程 123 老码农
生活随笔 收集整理的这篇文章主要介绍了 SimpleAuthenticationInfo 小编觉得挺不错的,现在分享给大家,帮大家做个参考.
 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的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。