轻量级权限控制框架
流程
// 把配置文件中的账号信息记录在 SimpleAccountRealm 中,执行 currentUser.login 时与请求账号比较1. 遍历 realms2. realms.size == 1 执行 doSingleRealmAuthentication2.1 获取 realm.getAuthenticationInfo2.2 执行 SimpleAccountRealm.doGetAuthenticationInfo 验证2.3 从客户端传递的参数组成的 UsernamePasswordToken token 中获取 username2.4 根据 token.username 查询 SimpleAccountRealm 缓存的 shiro.ini 账号信息 accountInfo2.5 选取 SimpleCredentialsMatcher 比对 token.getCredentials() 和 accountInfo.getCredentials()3. realms.size != 1 执行 doMultiRealmAuthentication4. 登录成功4.1 Subject loggedIn = this.createSubject(token, info, subject);4.2 this.onSuccessfulLogin(token, info, loggedIn);
