package com.iformall.shiro; import com.iformall.enums.EnumLoginType; 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; @Configuration public class MyRetryLimitCredentialsMatcher extends HashedCredentialsMatcher { @Override public boolean doCredentialsMatch(AuthenticationToken authcToken, AuthenticationInfo info) { if(authcToken instanceof UseriFormallToken) { UseriFormallToken tk = (UseriFormallToken) authcToken; if(tk.getType().equals(EnumLoginType.NOPASSWD)){ return true; } boolean matches = super.doCredentialsMatch(authcToken, info); return matches; } boolean matches =super.doCredentialsMatch(authcToken, info); return matches; } }