@Bean
        @ConditionalOnMissingBean(name = "delegatedAuthenticationErrorViewResolver")
        @RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
        public ErrorViewResolver delegatedAuthenticationErrorViewResolver(
            @Qualifier(DelegatedClientAuthenticationFailureEvaluator.BEAN_NAME)
            final DelegatedClientAuthenticationFailureEvaluator delegatedClientAuthenticationFailureEvaluator,
            final WebProperties webProperties,
            final ConfigurableApplicationContext applicationContext) {

            val mappings = Map.<Class<? extends Throwable>, ModelAndView>of(
                UnauthorizedServiceException.class, WebUtils.toModelAndView(HttpStatus.FORBIDDEN, CasWebflowConstants.VIEW_ID_DELEGATED_AUTHN_ERROR_VIEW),
                UnknownTenantException.class, WebUtils.toModelAndView(HttpStatus.NOT_FOUND, CasWebflowConstants.VIEW_ID_UNKNOWN_TENANT)
            );

            val resolver = new MappedExceptionErrorViewResolver(applicationContext,
                webProperties.getResources(), mappings,
                errorContext -> delegatedClientAuthenticationFailureEvaluator.evaluate(errorContext.request(), errorContext.status().value()));
            resolver.setOrder(0);
            return resolver;
        }
This is {@link DelegatedAuthenticationWebflowConfiguration}.

@author Misagh Moayyed
@since 5.0.0
support/cas-server-support-pac4j-webflow/src/main/java/org/apereo/cas/config/DelegatedAuthenticationWebflowConfiguration.java