protected Principal resolvePrincipal(final Principal principal) {
        val resolvers = new ArrayList<>(applicationContext.getBeansOfType(MultifactorAuthenticationPrincipalResolver.class).values());
        AnnotationAwareOrderComparator.sort(resolvers);
        return resolvers
            .stream()
            .filter(resolver -> resolver.supports(principal))
            .findFirst()
            .map(r -> r.resolve(principal))
            .orElseThrow(() -> new IllegalStateException("Unable to resolve principal for multifactor authentication"));
    }
This is {@link BaseMultifactorAuthenticationProviderBypassEvaluator}.

@author Misagh Moayyed
@since 6.1.0
core/cas-server-core-authentication-mfa-api/src/main/java/org/apereo/cas/authentication/bypass/BaseMultifactorAuthenticationProviderBypassEvaluator.java