use of org.apereo.cas.authentication.MultifactorAuthenticationRequiredException in project cas by apereo.
the class PrincipalAttributeMultifactorAuthenticationTrigger method resolveMultifactorAuthenticationProvider.
/**
* Resolve multifactor authentication provider set.
*
* @param context the context
* @param service the service
* @param principal the principal
* @return the set
*/
protected Set<Event> resolveMultifactorAuthenticationProvider(final Optional<RequestContext> context, final RegisteredService service, final Principal principal) {
val events = determineMultifactorAuthenticationEvent(context, service, principal);
val deny = casProperties.getAuthn().getMfa().getTriggers().getPrincipal().isDenyIfUnmatched();
if (deny && (events == null || events.isEmpty())) {
throw new AuthenticationException(new MultifactorAuthenticationRequiredException(service, principal));
}
return events;
}
Aggregations