@Override public Set<Event> resolveInternal(final RequestContext context) { val resolvedEvents = getResolvedEventsAsAttribute(context); val authentication = WebUtils.getAuthentication(context); val registeredService = resolveRegisteredServiceInRequestContext(context); val request = WebUtils.getHttpServletRequestFromExternalWebflowContext(context); return resolveEventsInternal(resolvedEvents, authentication, registeredService, request, context); }
/** * Resolve events internal set. Implementation may filter events from the collection * to only return the one that is appropriate for this request. The default * implementation returns the entire collection. * * @param resolveEvents the resolve events * @param authentication the authentication * @param registeredService the registered service * @param request the request * @param context the request context * @return the set of resolved events */ protected Set<Event> resolveEventsInternal(final Set<Event> resolveEvents, final Authentication authentication, final RegisteredService registeredService, final HttpServletRequest request, final RequestContext context) { if (!resolveEvents.isEmpty()) { LOGGER.trace("Collection of resolved events for this authentication sequence are:"); resolveEvents.forEach(e -> LOGGER.trace("Event id [{}] resolved from [{}]", e.getId(), e.getSource().getClass().getName())); } else { LOGGER.trace("No events could be resolved for this authentication transaction [{}] and service [{}]", authentication, registeredService); } val pair = filterEventsByMultifactorAuthenticationProvider(resolveEvents, authentication, registeredService, request); WebUtils.putResolvedMultifactorAuthenticationProviders(context, pair.getValue()); return pair.getKey(); }
@ConditionalOnMissingBean(name = "selectiveAuthenticationProviderWebflowEventResolver") @Bean @RefreshScope public CasWebflowEventResolver selectiveAuthenticationProviderWebflowEventResolver() { return new SelectiveMultifactorAuthenticationProviderWebflowEventEventResolver( authenticationSystemSupport.getIfAvailable(), centralAuthenticationService.getIfAvailable(), servicesManager.getIfAvailable(), ticketRegistrySupport.getIfAvailable(), warnCookieGenerator.getIfAvailable(), authenticationServiceSelectionPlan.getIfAvailable(), multifactorAuthenticationProviderSelector(), applicationEventPublisher, applicationContext); }