use of org.apereo.cas.adaptors.duo.authn.DuoSecurityUniversalPromptCredential in project cas by apereo.
the class DuoSecurityUniversalPromptValidateLoginAction method populateContextWithCredential.
/**
* Populate context with credential.
*
* @param requestContext the request context
* @param ticket the ticket
* @param authentication the authentication
*/
protected void populateContextWithCredential(final RequestContext requestContext, final TransientSessionTicket ticket, final Authentication authentication) {
val requestParameters = requestContext.getRequestParameters();
val duoCode = requestParameters.get(REQUEST_PARAMETER_CODE, String.class);
LOGGER.trace("Received Duo Security code [{}]", duoCode);
val duoSecurityIdentifier = ticket.getProperty("duoProviderId", String.class);
val credential = new DuoSecurityUniversalPromptCredential(duoCode, authentication);
val provider = duoProviderBean.getProvider(duoSecurityIdentifier);
credential.setProviderId(provider.getId());
WebUtils.putCredential(requestContext, credential);
}
Aggregations