@Override
    public boolean generateToken(final Principal principal, final WebApplicationService service) {
        val channels = determineVerificationChannels(principal, service);
        val recipient = principal.getSingleValuedAttribute(properties.getCore().getRecipientAttributeName(), String.class);
        LOGGER.debug("Sending Twilio verification attempt to recipient [{}] via [{}]", recipient, channels);
        val serviceSid = SpringExpressionLanguageValueResolver.getInstance().resolve(properties.getCore().getServiceSid());
        return channels
            .stream()
            .anyMatch(channel -> FunctionUtils.doAndHandle(() -> {
                val verification = Verification.creator(serviceSid, recipient, channel.toString()).create();
                LOGGER.debug("Generated token for [{}] with SID: [{}]", principal.getId(), verification);
                return StringUtils.isNotBlank(verification.getSid());
            }, e -> false).get());
    }
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