@Override
    public Principal validate(final Principal principal, final CasTwilioMultifactorTokenCredential credential) throws Throwable {
        val verificationCheck = verifyAttempt(principal, credential);
        LOGGER.debug("Verification check result for [{}] is [{}]", principal.getId(), verificationCheck);
        val valid = verificationCheck != null
            && verificationCheck.getValid()
            && StringUtils.isNotBlank(verificationCheck.getStatus())
            && Verification.Status.forValue(verificationCheck.getStatus()) == Verification.Status.APPROVED
            && StringUtils.isNotBlank(verificationCheck.getSid());
        FunctionUtils.throwIf(!valid,
            () -> new MultifactorAuthenticationFailedException("Twilio verification failed for %s".formatted(principal.getId())));
        return principal;
    }
This is {@link CasDefaultTwilioMultifactorAuthenticationService}.

@author Misagh Moayyed
@since 7.2.0
support/cas-server-support-twilio-mfa/src/main/java/org/apereo/cas/mfa/twilio/CasDefaultTwilioMultifactorAuthenticationService.java