【发布时间】:2017-03-17 03:04:57
【问题描述】:
我在 Spring Boot Web 应用程序中使用过滤器将我的所有用户请求记录到数据库中。我想记录的一件事是用户名,但是当我尝试让当前用户使用时:
SecurityUtils.getSubject().getPrincipal()
我收到以下错误:
No SecurityManager accessible to the calling code, either bound to the org.apache.shiro.util.ThreadContext or as a vm static singleton. This is an invalid application configuration.
我需要做什么才能让我的过滤器能够检索当前用户?
【问题讨论】:
-
你确定shiro环境启动成功了吗?请分享您的 shiro.ini 文件
标签: spring-boot servlet-filters shiro