@Override
    public DuoSecurityAuthenticationResult authenticate(final Credential credential) throws Exception {
        if (credential instanceof final DuoSecurityPasscodeCredential duo) {
            return authenticateDuoPasscodeCredential(duo);
        }
        if (credential instanceof final DuoSecurityDirectCredential duo) {
            return authenticateDuoCredentialDirect(duo);
        }
        return authenticateInternal(credential);
    }
This is {@link BaseDuoSecurityAuthenticationService}.

@author Misagh Moayyed
@since 5.1.0
support/cas-server-support-duo-core/src/main/java/org/apereo/cas/adaptors/duo/authn/BaseDuoSecurityAuthenticationService.java