@Override
    protected AuthenticationHandlerExecutionResult doAuthentication(final Credential credential, final Service service) throws Throwable {
        val inweboCredential = (InweboCredential) credential;
        val login = inweboCredential.getLogin();
        LOGGER.trace("Inwebo credential login is [{}]", login);

        val otp = inweboCredential.getOtp();
        var authenticated = inweboCredential.isAlreadyAuthenticated();
        var deviceName = inweboCredential.getDeviceName();
        if (StringUtils.isNotBlank(otp)) {
            val response = this.service.authenticateExtended(login, otp);
            if (response.isOk()) {
                authenticated = true;
                deviceName = response.getDeviceName();
            }
        }

        if (authenticated) {
            inweboCredential.setDeviceName(deviceName);
            LOGGER.info("Authenticated user: [{}] for device: [{}]", login, deviceName);
            val principal = this.principalFactory.createPrincipal(login);
            return createHandlerResult(inweboCredential, principal);
        }
        throw new FailedLoginException("Cannot validate authentication for: " + login);
    }
The Inwebo authentication handler.

@author Jerome LELEU
@since 6.4.0
support/cas-server-support-inwebo-mfa/src/main/java/org/apereo/cas/support/inwebo/authentication/InweboAuthenticationHandler.java