摘要: 自定义realm; 1、UserRealm父类AuthorizingRealm将获取Subject相关信息分成两步:获取身份验证信息(doGetAuthenticationInfo)及授权信息(doGetAuthorizationInfo); 2、doGetAuthenticationInfo获取身 阅读全文
posted @ 2018-06-13 01:24 喂,我养你啊 阅读(341) 评论(0) 推荐(0)
摘要: 一、身份验证 先来看看身份验证的流程 流程如下: 1、首先调用Subject.login(token)进行登录,其会自动委托给Security Manager,调用之前必须通过SecurityUtils. setSecurityManager()设置; 2、SecurityManager负责真正的身 阅读全文
posted @ 2018-06-13 01:13 喂,我养你啊 阅读(441) 评论(0) 推荐(0)
摘要: Apache Shiro是Java的一个安全框架。目前,使用Apache Shiro的人越来越多,因为它相当简单,对比Spring Security,可能没有Spring Security做的功能强大,但是在实际工作时可能并不需要那么复杂的东西,所以使用小而简单的Shiro就足够了。 Shiro可以 阅读全文
posted @ 2018-06-13 00:39 喂,我养你啊 阅读(267) 评论(0) 推荐(0)