class BrokerAuthenticator implements IAuthenticator {

    @Override
    public boolean checkValid(String clientId, String username, byte[] password) {
        if (StringUtils.isBlank(username) || password == null) {
            return false;
        }

        try {
            IAuthorizer authorizer = BasicAuthorizer.getInstance();
            return authorizer.login(username, new String(password));
        } catch (AuthException e) {
            LOG.info("meet error while logging in.", e);
            return false;
        }
    }

}