@Override
    public boolean isTokenAuthorizedFor(final int token, final OneTimeTokenAccount account) {
        LOGGER.debug("Authorizing token [{}] against account [{}]", token, account);
        val authorized = googleAuthenticatorInstance.authorize(account.getSecretKey(), token);
        if (!authorized && account.getScratchCodes().stream().map(Number::intValue).toList().contains(token)) {
            LOGGER.debug("Token [{}] is a valid scratch code for account [{}]", token, account);
            account.getScratchCodes().removeIf(code -> code.intValue() == token);
            credentialRepository.update(account);
            return true;
        }
        return authorized;
    }
This is {@link GoogleAuthenticatorOneTimeTokenCredentialValidator}.

@author Misagh Moayyed
@since 6.3.0
support/cas-server-support-gauth-core/src/main/java/org/apereo/cas/gauth/credential/GoogleAuthenticatorOneTimeTokenCredentialValidator.java