Shiro 免密登录
最近做接入SSO单点登录,需要从别的系统返回的用户然后直接登录,所以需要用到免密登录,其实很简单,自己写一个类继承HashedCredentialsMatcher类,然后重写doCredentialsMatch,判断免密登录规则可结合实际业务需求更改,符合规则的return true就代表密码校验通过,代码如下: import org.apache.shiro.authc.AuthenticationInfo; import org.apache.shiro.authc.AuthenticationToken; import org.apache.shiro.authc.credential.HashedCredentialsMatcher; public class CybHashedCredentialsMatcher extends HashedCredentialsMatcher { @Override public boolean doCredentialsMatch(AuthenticationToken authcToken, AuthenticationInfo info) { UsernamePasswordToken token = (UsernamePasswordToken) authcToken; if(StringUtils.isNotBlank