protected void evaluateFinalAuthentication(final AuthenticationBuilder builder,
                                               final AuthenticationTransaction transaction,
                                               final Set<AuthenticationHandler> authenticationHandlers) throws Throwable {
        val clientInfo = ClientInfoHolder.getClientInfo();
        if (builder.getSuccesses().isEmpty()) {
            if (builder.getFailures().isEmpty()) {
                LOGGER.warn("The resulting authentication attempt has not recorded any successes or failures. This typically means that no authentication handler "
                    + "could be found to support the authentication request or the credential types provided. The authentication handlers that were "
                    + "examined are: [{}]", authenticationHandlers.stream().map(AuthenticationHandler::getName).collect(Collectors.joining(", ")));
            }
            publishEvent(new CasAuthenticationTransactionFailureEvent(this, builder.getFailures(), transaction.getCredentials(), clientInfo));
            throw createAuthenticationException(builder);
        }

        val authentication = builder.build();
        val executionResult = evaluateAuthenticationPolicies(authentication, transaction, authenticationHandlers);
        if (!executionResult.isSuccess()) {
            publishEvent(new CasAuthenticationPolicyFailureEvent(this, builder.getFailures(), transaction, authentication, clientInfo));
            executionResult.getFailures().forEach(e -> handleAuthenticationException(e, e.getClass().getSimpleName(), builder));
            throw createAuthenticationException(builder);
        }
    }
This is {@link DefaultAuthenticationManager}, which provides common operations
around an authentication manager implementation.

@author Misagh Moayyed
@since 5.0.0
core/cas-server-core-authentication-api/src/main/java/org/apereo/cas/authentication/DefaultAuthenticationManager.java