package com.yunzhi.demo.shiro.matcher; import com.yunzhi.demo.shiro.utils.JWTUtil; import org.apache.shiro.authc.AuthenticationInfo; import org.apache.shiro.authc.AuthenticationToken; import org.apache.shiro.authc.credential.CredentialsMatcher; public class JWTCredentialsMatcher implements CredentialsMatcher { @Override public boolean doCredentialsMatch(AuthenticationToken authenticationToken, AuthenticationInfo authenticationInfo) { String token = authenticationToken.getCredentials().toString(); return JWTUtil.verify(token); } }