[main]
sha256Matcher = org.apache.shiro.authc.credential.Sha256CredentialsMatcher
nutzdao_realm = org.nutz.ctemplate.support.shiro.NutDaoRealm
nutzdao_realm.credentialsMatcher = $sha256Matcher
securityManager.realms = $nutzdao_realm
authc = org.apache.shiro.web.filter.authc.PassThruAuthenticationFilter
logout.redirectUrl= /
[urls]
/static/** = anon
/index = anon
/ = anon
/logout = logout
;/user/error = anon
;/user/profile/active/mail = anon
/login/** = anon
/register/** = anon
/** = authc
使用PassThruAuthenticationFilter
登陆方法
UsernamePasswordToken token = new UsernamePasswordToken(username, password);
// 获取当前的Subject
Subject currentUser = SecurityUtils.getSubject();
try {
currentUser.login(token);
为什么登陆的时候短点不走NutDaoRealm中的
protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) throws AuthenticationException
方法呢?