use of org.apereo.cas.services.MultifactorAuthenticationProvider in project cas by apereo.
the class AbstractCasWebflowEventResolver method resolveEventViaAttribute.
private Set<Event> resolveEventViaAttribute(final Principal principal, final Map<String, Object> attributesToExamine, final Collection<String> attributeNames, final RegisteredService service, final RequestContext context, final Collection<MultifactorAuthenticationProvider> providers, final Predicate<String> predicate) {
if (providers == null || providers.isEmpty()) {
LOGGER.debug("No authentication provider is associated with this service");
return null;
}
LOGGER.debug("Locating attribute value for attribute(s): [{}]", attributeNames);
for (final String attributeName : attributeNames) {
final Object attributeValue = attributesToExamine.get(attributeName);
if (attributeValue == null) {
LOGGER.debug("Attribute value for [{}] to determine event is not configured for [{}]", attributeName, principal.getId());
continue;
}
LOGGER.debug("Selecting a multifactor authentication provider out of [{}] for [{}] and service [{}]", providers, principal.getId(), service);
final MultifactorAuthenticationProvider provider = this.multifactorAuthenticationProviderSelector.resolve(providers, service, principal);
LOGGER.debug("Located attribute value [{}] for [{}]", attributeValue, attributeNames);
Set<Event> results = resolveEventViaSingleAttribute(principal, attributeValue, service, context, provider, predicate);
if (results == null || results.isEmpty()) {
results = resolveEventViaMultivaluedAttribute(principal, attributeValue, service, context, provider, predicate);
}
if (results != null && !results.isEmpty()) {
LOGGER.debug("Resolved set of events based on the attribute [{}] are [{}]", attributeName, results);
return results;
}
}
LOGGER.debug("No set of events based on the attribute(s) [{}] could be matched", attributeNames);
return null;
}
Aggregations