
Shiro
文章平均质量分 85
codezrh
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
SpringBoot+Shiro+JWT简单配置要点(思路)
首先, 附上一张Shiro核心架构图 配置要点 配置Security Manager 创建并配置Realm 在使用JWT作为凭证的web应用中, 需要有这两个Realm: UsernamePasswordRealm JWTRealm 其中UsernamePasswordRealm用于登录, JWTRealm用于对header中携带jwt的请求 配置Authenticator 在Authenticator中, 可以配置验证器的相关行为. 验证器调用Realm的doAuthentic..原创 2021-06-16 00:44:08 · 305 阅读 · 0 评论 -
AuthenticationStrategy在验证过程中到底做了什么
Shiro getAuthenticationInfo()中抛出异常, 全局异常处理却收不到自己抛出的异常中, 介绍了通过覆盖AuthenticationStrategy的afterAttempt方法, 更改Shiro的异常抛出逻辑. 本文介绍AuthenticationStrategy在验证过程中到底做了什么 想要弄清Strategy, 就要关注在ModularRealmAuthenticator.doMultiRealmAuthentication()的aggregate protected A原创 2021-05-24 09:21:40 · 536 阅读 · 0 评论 -
Shiro getAuthenticationInfo()中抛出异常, 全局异常处理却收不到自己抛出的异常
getAuthenticationInfo()中抛出异常, 全局异常处理却收不到自己抛出的异常 该解决思路来自StackOverflow: Apache Shiro: Exception-Handling with Multiple Realms 首先下结论: 这是因为使用了默认的AuthenticationStrategy所致, 只需要为自己的shiro实现自定义的AuthenticationStrategy即可. 配置AuthenticationStrategy的方法如下: MyAtLeastOneSu原创 2021-05-23 22:36:11 · 1573 阅读 · 1 评论