创建SimpleAuthenticationInfo实例时传入下列三个参数
Apache Shiro:SimpleAuthenticationInfo的第一个参数到底是user对象还是username
SimpleAuthenticationInfo中可以传四个参数也可以传三个参数(下面是源码)
Apache Shiro:SimpleAuthenticationInfo的第一个参数到底是user对象还是username
第一个参数,有人说传的user对象,也有人说传的是user的username,我们点进SimplePrincipalCollection的构造方法看一下,在创建SimplePrincipalCollection实例的时候传入的第一个参数,判断是否是一个对象,是或者不是对象,最终都会加入到SimplePrincipalCollection实例中,所以我们可以发现SimpleAuthenticationInfo的第一个参数既可以是user对象也可以是username
Apache Shiro:SimpleAuthenticationInfo的第一个参数到底是user对象还是username

相关文章:

  • 2021-12-06
  • 2021-10-04
  • 2021-05-30
  • 2022-02-14
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-10-28
  • 2021-11-20
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案