@Override
	public boolean checkPassword(String username, String password) {

		if (username == null || username.isEmpty() || password == null
				|| password.isEmpty()) {
			throw new IllegalArgumentException("Argumentos nulos.");
		}

		if (!existUser(username)) {
			throw new IllegalArgumentException(
					"El usuario introducido no existe en el sistema.");
		}

		User user = getUser(username);

//		String encodePass = encodePassword(password);
//		logger.trace("Comparand password " + user.getPass() + " == " + encodePass + "->" + user.getPass().equalsIgnoreCase(encodePass));
		return user.getPass().equals(encodePassword(password));
	}