@Override
    protected AuthenticationHandlerExecutionResult doAuthentication(final Credential credential, final Service service) throws Exception {
        if (credential instanceof final DuoSecurityPasscodeCredential duo) {
            LOGGER.debug("Attempting to authenticate credential via Duo Security passcode");
            return authenticateDuoPasscodeCredential(duo);
        }
        if (credential instanceof final DuoSecurityUniversalPromptCredential duo) {
            LOGGER.debug("Attempting to authenticate credential via Duo Security universal prompt");
            return authenticateDuoUniversalPromptCredential(duo);
        }
        if (credential instanceof final DuoSecurityDirectCredential duo) {
            LOGGER.debug("Attempting to directly authenticate credential against Duo");
            return authenticateDuoApiCredential(duo);
        }
        throw new FailedLoginException("Unknown Duo Security authentication attempt");
    }
Do an out of band request using the DuoWeb api (encapsulated in {@link DuoSecurityAuthenticationService})
to the hosted duo service. If it is successful
it will return a String containing the username of the successfully authenticated user, but if not - will
return a blank String or null.

@param credential Credential to authenticate.
@param service the requesting service, if any.
@return the result of this handler
@throws GeneralSecurityException general security exception for errors
support/cas-server-support-duo-core/src/main/java/org/apereo/cas/adaptors/duo/authn/DuoSecurityAuthenticationHandler.java