@Override
    protected Event doExecuteInternal(final RequestContext requestContext) {
        val authentication = WebUtils.getAuthentication(requestContext);
        val credential = new DuoSecurityDirectCredential(resolvePrincipal(authentication.getPrincipal(), requestContext), provider.getId());
        val credentialMetadata = new BasicCredentialMetadata(credential);
        credentialMetadata.setTenant(tenantExtractor.extract(requestContext).map(TenantDefinition::getId).orElse(null));
        credential.setCredentialMetadata(credentialMetadata);
        WebUtils.putCredential(requestContext, credential);
        return success();
    }
This is {@link DuoSecurityDirectAuthenticationAction}.

@author Misagh Moayyed
@since 5.0.0
support/cas-server-support-duo-core/src/main/java/org/apereo/cas/adaptors/duo/web/flow/action/DuoSecurityDirectAuthenticationAction.java