Shiro的login究竟经过了哪些类和方法

Subject.login设计的类和方法

  1. Controller中我们使用subject.login(token)来执行登陆操作
  2. DelegatingSubject.login中使用securityManager.login(this.token)
  3. DefaultSecrityManager(这里我注入的是这个secrityManager,也可以自定义).login中使用authenticate(token)
  4. AuthenticatingSecurityManager.authenticate中使用authenticator.authenticate(token)
  5. AbstractAuthenticator.authenticate中使用doAuthenticate(token)
  6. ModularRealmAuthenticator.doAuthenticate中通过getRealms来得到所有的Realm,然后使用(我假设这里只定义了一个realm)doSingleRealmAuthentication(realm, authenticationtoekn)
  7. ModularReamlmAuthenticator.doSingleRealmAuthentication中使用了Realm.getAuthenticationInfo(token)
  8. AUthenticatingRealm中使用doGetAuthenticatingInfor(token),这个方法其实就是我们自定的Realm中的方法,而后使用assertCredentialsMatch(token,info)
  9. 自定义或者默认的CredentialMatcher的doCredentialsMatch方法对info中的Credential和token中的crediential进行比对

以上就是login涉及到的过程 ,后续自定义其中的类可以进行参阅

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值