package com.dcit.authority.shiro.matcher;

import org.apache.shiro.authc.AuthenticationInfo;
import org.apache.shiro.authc.AuthenticationToken;
import org.apache.shiro.authc.credential.CredentialsMatcher;
import org.springframework.stereotype.Component;

/**
* <p>Title: PasswordMatcher</p>
* <p>Description: </p>
* <p>Company: SJZ DC-IT co. LTD</p> 
* @author ZZZ
* @date 2018年9月6日 下午8:25:26
*/
@Component
public class PasswordMatcher implements CredentialsMatcher {

	@Override
	public boolean doCredentialsMatch(AuthenticationToken token, AuthenticationInfo info) {
		return token.getPrincipal().toString().equals(info.getPrincipals().getPrimaryPrincipal().toString())
        && token.getCredentials().toString().equals(info.getCredentials().toString());
	}

}
