use of org.springframework.webflow.action.EventFactorySupport in project cas by apereo.
the class RedirectToServiceAction method doExecute.
@Override
protected Event doExecute(final RequestContext requestContext) throws Exception {
final WebApplicationService service = WebUtils.getService(requestContext);
final String serviceTicketId = WebUtils.getServiceTicketFromRequestScope(requestContext);
final Response response = responseBuilderLocator.locate(service).build(service, serviceTicketId);
WebUtils.putServiceResponseIntoRequestScope(requestContext, response);
WebUtils.putServiceOriginalUrlIntoRequestScope(requestContext, service);
return new EventFactorySupport().event(this, response.getResponseType().name().toLowerCase());
}
use of org.springframework.webflow.action.EventFactorySupport in project cas by apereo.
the class AzureAuthenticatorGenerateTokenAction method doExecute.
@Override
public Event doExecute(final RequestContext requestContext) {
final Integer code = Integer.valueOf(RandomStringUtils.randomNumeric(8));
final AzureAuthenticatorTokenCredential c = new AzureAuthenticatorTokenCredential();
c.setToken(code.toString());
WebUtils.putCredential(requestContext, c);
requestContext.getFlowScope().put("azureToken", code);
if (mode == AzureMultifactorProperties.AuthenticationModes.POUND) {
return new EventFactorySupport().event(this, "authenticate");
}
return success();
}
use of org.springframework.webflow.action.EventFactorySupport in project cas by apereo.
the class AuthyAuthenticationWebflowEventResolverTests method verifyOperation.
@Test
public void verifyOperation() {
val authn = RegisteredServiceTestUtils.getAuthentication("casuser");
val builder = mock(AuthenticationResultBuilder.class);
when(builder.getInitialAuthentication()).thenReturn(Optional.of(authn));
when(builder.collect(any(Authentication.class))).thenReturn(builder);
WebUtils.putAuthenticationResultBuilder(builder, context);
WebUtils.putAuthentication(authn, context);
val event = resolver.resolveSingle(context);
assertEquals(CasWebflowConstants.TRANSITION_ID_ERROR, event.getId());
val support = new EventFactorySupport();
assertTrue(event.getAttributes().contains(support.getExceptionAttributeName()));
}
use of org.springframework.webflow.action.EventFactorySupport in project cas by apereo.
the class InitializeCaptchaAction method doExecute.
@Override
protected Event doExecute(final RequestContext requestContext) {
activationStrategy.shouldActivate(requestContext, recaptchaProperties).ifPresent(properties -> {
WebUtils.putRecaptchaPropertiesFlowScope(requestContext, properties);
onActivationConsumer.accept(requestContext);
});
return new EventFactorySupport().success(this);
}
use of org.springframework.webflow.action.EventFactorySupport in project cas by apereo.
the class QRAuthenticationValidateTokenAction method doExecute.
@Override
protected Event doExecute(final RequestContext requestContext) {
val request = WebUtils.getHttpServletRequestFromExternalWebflowContext(requestContext);
val token = request.getParameter(TokenConstants.PARAMETER_NAME_TOKEN);
val deviceId = request.getParameter("deviceId");
LOGGER.debug("Received QR token [{}] with device identifier [{}]", token, deviceId);
val credential = new QRAuthenticationTokenCredential(token, deviceId);
WebUtils.putCredential(requestContext, credential);
return new EventFactorySupport().event(this, CasWebflowConstants.TRANSITION_ID_FINALIZE);
}
Aggregations