@Override
    public boolean isValid(final String uid, final String token) {
        try {
            val yubikeyPublicId = getTokenPublicId(token);
            if (StringUtils.isNotBlank(yubikeyPublicId)) {
                val response = this.client.verify(token);
                val status = response.getStatus();
                if (status.compareTo(ResponseStatus.OK) == 0) {
                    LOGGER.debug("YubiKey response status [{}] at [{}]", status, response.getTimestamp());
                    return true;
                }
                LOGGER.error("Failed to verify YubiKey token: [{}]", response);
            } else {
                LOGGER.error("Invalid YubiKey token: [{}]", token);
            }
        } catch (final Exception e) {
            LoggingUtils.error(LOGGER, e);
        }
        return false;
    }
This is {@link DefaultYubiKeyAccountValidator}.

@author Misagh Moayyed
@since 5.2.0
support/cas-server-support-yubikey-core/src/main/java/org/apereo/cas/adaptors/yubikey/DefaultYubiKeyAccountValidator.java