我要把登录的用户信息放session中
是不是只能在onLoginSuccess里 再单独查询一下用户信息放进去
一定要要单独再查询么 好像之前已经查询过一次了
建议换新版插件中的simplefilter
我已经是nutz-integration-shiro-1.r.56-sources.jar
simplefilter怎么用?
我要把登录的用户信息放session中
是不是只能在onLoginSuccess里 再单独查询一下用户信息放进去
一定要要单独再查询么 好像之前已经查询过一次了
建议换新版插件中的simplefilter
我已经是nutz-integration-shiro-1.r.56-sources.jar
simplefilter怎么用?
@congratulations1 没用Filter方式做登陆而已, 但一样是shiro的login登陆.
HTTP Status 403 -
type Status report
message
description Access to the specified resource has been forbidden.
Apache Tomcat/7.0.56
[main]
sha256Matcher = org.apache.shiro.authc.credential.Sha256CredentialsMatcher
cacheManager = org.apache.shiro.cache.ehcache.EhCacheManager
securityManager.cacheManager = $cacheManager
nutzdao_realm = com.erpc.base.shiro.realm.SimpleAuthorizingRealm
nutzdao_realm.credentialsMatcher = $sha256Matcher
authc = org.nutz.integration.shiro.SimpleAuthenticationFilter
authc.loginUrl = /user/login
logout.redirectUrl= /user/login
[urls]
/rs/* = anon
/user/logout = logout
/user/error = anon
/user/profile/active/mail = anon
/user/** = authc
[main]
sha256Matcher = org.apache.shiro.authc.credential.Sha256CredentialsMatcher
cacheManager = org.apache.shiro.cache.ehcache.EhCacheManager
securityManager.cacheManager = $cacheManager
nutzdao_realm = com.erpc.base.shiro.realm.SimpleAuthorizingRealm
nutzdao_realm.credentialsMatcher = $sha256Matcher
authc = org.nutz.integration.shiro.SimpleAuthenticationFilter
authc.loginUrl = /user/login
logout.redirectUrl= /user/login
[urls]
/rs/* = anon
/user/logout = logout
/user/error = anon
/user/profile/active/mail = anon
/user/** = authc
好像不识别井号,这是我的ini,403的时候 没有任何日志输出
访问的地址 http://localhost:8080/ERPCloud/user/toHome
以前没从入口方法登录的时候 访问这个地址 就跳转到登录页面了
刚刚看了一下SimpleAuthenticationFilter的代码
protected boolean onAccessDenied(ServletRequest request, ServletResponse response) throws Exception {
((HttpServletResponse)response).sendError(403);
return false;
}
继承它改一下, 或者我提交个修改?
http://shiro.apache.org/webapp-tutorial.html#step5
/account/** = authc
# This Shiro filter chain definition means “Any requests to /account (or any of its sub-paths) must be authenticated”.