MyRetryLimitCredentialsMatcher.java 1014 Bytes
package com.glsx.usercenter.shiro;

import org.apache.shiro.authc.AuthenticationInfo;
import org.apache.shiro.authc.AuthenticationToken;
import org.apache.shiro.authc.credential.HashedCredentialsMatcher;
import org.springframework.context.annotation.Configuration;

import com.glsx.usercenter.constants.LoginType;

/**
 * 
 * @Title MyRetryLimitCredentialsMatcher.java
 * @Package com.glsx.usercenter.shiro
 * @Description TODO 密码凭证管理器
 * @author zhanghj
 * @date 2019年4月25日 上午10:43:04
 * @version 1.0.0
 */
@Configuration
public class MyRetryLimitCredentialsMatcher extends HashedCredentialsMatcher {
	 @Override
	    public boolean doCredentialsMatch(AuthenticationToken authcToken, AuthenticationInfo info) {
	        CustomToken tk = (CustomToken) authcToken;
	        if(tk.getType().equals(LoginType.NOPASSWD)){
	            return true;
	        }
	        boolean matches = super.doCredentialsMatch(authcToken, info);
	        return matches;
	    }
}