轻量级权限控制框架

流程

  1. // 把配置文件中的账号信息记录在 SimpleAccountRealm 中,执行 currentUser.login 时与请求账号比较
  2. 1. 遍历 realms
  3. 2. realms.size == 1 执行 doSingleRealmAuthentication
  4. 2.1 获取 realm.getAuthenticationInfo
  5. 2.2 执行 SimpleAccountRealm.doGetAuthenticationInfo 验证
  6. 2.3 从客户端传递的参数组成的 UsernamePasswordToken token 中获取 username
  7. 2.4 根据 token.username 查询 SimpleAccountRealm 缓存的 shiro.ini 账号信息 accountInfo
  8. 2.5 选取 SimpleCredentialsMatcher 比对 token.getCredentials() accountInfo.getCredentials()
  9. 3. realms.size != 1 执行 doMultiRealmAuthentication
  10. 4. 登录成功
  11. 4.1 Subject loggedIn = this.createSubject(token, info, subject);
  12. 4.2 this.onSuccessfulLogin(token, info, loggedIn);