Shiro | 实现权限验证完整版
写在前面的话 提及权限,就会想到安全,是一个十分棘手的话题。这里只是作为学校Shiro的一个记录,而不是,权限就应该这样设计之类的。 Shiro框架 1、Shiro是基于Apache开源的强大灵活的开源安全框架。 2、Shiro提供了 认证,授权,企业会话管理、安全加密、缓存管理。 3、Shiro与Security对比 4、Shiro整体架构 5、特性 6、认证流程 认证 当我们理解Shiro之后,我们就能比较容易梳理出认证流程,大概就是下面这样子。 我们来看一段测试代码: // 1.构建SecurityManager环境 DefaultSecurityManager defaultSecurityManager = new DefaultSecurityManager(); defaultSecurityManager.setRealm(simpleAccountRealm); // 2.主体提交认证请求 SecurityUtils.setSecurityManager(defaultSecurityManager); Subject subject = SecurityUtils....