use of org.springframework.webflow.action.EventFactorySupport in project cas by apereo.
the class AccepttoQRCodeValidateWebSocketChannelAction method returnError.
private Event returnError(final String message) {
val eventAttributes = new LocalAttributeMap<>();
LOGGER.error(message);
eventAttributes.put("error", new AuthenticationException(new UnauthorizedAuthenticationException(message)));
return new EventFactorySupport().event(this, CasWebflowConstants.TRANSITION_ID_AUTHENTICATION_FAILURE, eventAttributes);
}
use of org.springframework.webflow.action.EventFactorySupport in project cas by apereo.
the class AccepttoMultifactorFetchChannelAction method doExecute.
@Override
public Event doExecute(final RequestContext requestContext) throws Exception {
val request = WebUtils.getHttpServletRequestFromExternalWebflowContext(requestContext);
val response = WebUtils.getHttpServletResponseFromExternalWebflowContext(requestContext);
val webContext = new JEEContext(request, response);
val channel = authenticateAndFetchChannel(requestContext);
LOGGER.debug("Storing channel [{}] in session", channel);
AccepttoWebflowUtils.storeChannelInSessionStore(channel, webContext, sessionStore);
val authentication = WebUtils.getInProgressAuthentication();
AccepttoWebflowUtils.storeAuthenticationInSessionStore(authentication, webContext, sessionStore);
val accepttoRedirectUrl = buildAccepttoAuthenticationSelectionUrl(request, channel);
LOGGER.debug("Redirecting to [{}]", accepttoRedirectUrl);
requestContext.getRequestScope().put("accepttoRedirectUrl", accepttoRedirectUrl);
return new EventFactorySupport().success(this);
}
use of org.springframework.webflow.action.EventFactorySupport in project cas by apereo.
the class SurrogateEligibilitySelectionAuditResourceResolverTests method verifyOperation.
@Test
public void verifyOperation() {
val resolver = new SurrogateEligibilitySelectionAuditResourceResolver();
val jp = mock(JoinPoint.class);
val result = new HashMap<>();
result.put("key1", "value1");
result.put("key2", "value2");
val event = new EventFactorySupport().success(this, result);
val outcome = resolver.resolveFrom(jp, event);
assertTrue(outcome.length > 0);
}
use of org.springframework.webflow.action.EventFactorySupport in project cas by apereo.
the class SurrogateEligibilitySelectionAuditResourceResolver method resolveFrom.
@Override
public String[] resolveFrom(final JoinPoint auditableTarget, final Object returnValue) {
Objects.requireNonNull(returnValue, "Event must not be null");
val resultEvent = Event.class.cast(returnValue);
val resultAttributeName = new EventFactorySupport().getResultAttributeName();
val values = new HashMap<String, Object>(resultEvent.getAttributes().get(resultAttributeName, Map.class));
values.put("status", resultEvent.getId());
return new String[] { auditFormat.serialize(values) };
}
use of org.springframework.webflow.action.EventFactorySupport in project cas by apereo.
the class YubiKeyAccountCheckRegistrationAction method doExecute.
@Override
protected Event doExecute(final RequestContext requestContext) {
val authentication = WebUtils.getAuthentication(requestContext);
val uid = resolvePrincipal(authentication.getPrincipal()).getId();
if (registry.isYubiKeyRegisteredFor(uid)) {
return success();
}
return new EventFactorySupport().event(this, CasWebflowConstants.TRANSITION_ID_REGISTER);
}
Aggregations