protected void populateContextWithCredential(final RequestContext requestContext,
                                                 final Authentication authentication,
                                                 final String duoCode,
                                                 final String duoSecurityIdentifier) {
        LOGGER.trace("Received Duo Security code [{}] for Duo Security identifier [{}]", duoCode, duoSecurityIdentifier);
        val credential = new DuoSecurityUniversalPromptCredential(duoCode, authentication);
        val credentialMetadata = new BasicCredentialMetadata(credential);
        credentialMetadata.setTenant(tenantExtractor.extract(requestContext).map(TenantDefinition::getId).orElse(null));
        
        val applicationContext = requestContext.getActiveFlow().getApplicationContext();
        val provider = MultifactorAuthenticationUtils.getMultifactorAuthenticationProviderById(duoSecurityIdentifier, applicationContext)
            .orElseThrow(() -> new IllegalArgumentException("Unable to locate multifactor authentication provider by id " + duoSecurityIdentifier));
        credential.setProviderId(provider.getId());
        WebUtils.putCredential(requestContext, credential);
    }
This is {@link DuoSecurityUniversalPromptPrepareLoginAction}.

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