You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
运行以下代码报错 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-demo 工程
创建 shiro-test module
在 shiro-test 中引入相关依赖
核心思想
踩下的坑
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.
认证过程分析
使用 Subject.login(UsernamePasswordToken)
在 Subject.login(token) 的内部是通过调用 SecurityManager.login(delegateSubject, token)
DefaultSercurityManager.login 方法调用 AuthenticatingSecurityManager.authenticate(token) 方法来实现
authenticate 方法中,使用 authenticator.authenticate(token) 方法实现认证。
authenticator 中调用 ModularRealmAuthenticator.doAuthenticate 方法实现认证
The text was updated successfully, but these errors were encountered: