@Override
    protected Event doExecuteInternal(final RequestContext requestContext) {
        val redirectUrl = casProperties.getView().getDefaultRedirectUrl();
        if (StringUtils.isNotBlank(redirectUrl)) {
            val service = this.serviceFactory.createService(redirectUrl);
            val registeredService = this.servicesManager.findServiceBy(service);
            RegisteredServiceAccessStrategyUtils.ensureServiceAccessIsAllowed(service, registeredService);
            requestContext.getExternalContext().requestExternalRedirect(service.getId());
        } else {
            val tgt = WebUtils.getTicketGrantingTicketId(requestContext);
            getAuthentication(tgt).ifPresent(authn -> {
                WebUtils.putAuthentication(authn, requestContext);
                val service = WebUtils.getService(requestContext);
                if (casProperties.getView().isAuthorizedServicesOnSuccessfulLogin()) {
                    val authorizedServices = servicesManager.getAllServices()
                        .stream()
                        .filter(registeredService -> {
                            try {
                                return principalAccessStrategyEnforcer.authorize(
                                    RegisteredServicePrincipalAccessStrategyEnforcer.PrincipalAccessStrategyContext.builder()
                                        .registeredService(registeredService)
                                        .principalId(authn.getPrincipal().getId())
                                        .principalAttributes(CollectionUtils.merge(authn.getAttributes(), authn.getPrincipal().getAttributes()))
                                        .service(service)
                                        .applicationContext(requestContext.getActiveFlow().getApplicationContext())
                                        .build());
                            } catch (final Throwable e) {
                                LOGGER.info(e.getMessage(), e);
                                return false;
                            }
                        })
                        .collect(Collectors.toList());
                    WebUtils.putAuthorizedServices(requestContext, authorizedServices);
                }
            });
        }
        return success();
    }
Action that should execute prior to rendering the generic-success login view.

@author Misagh Moayyed
@since 4.1.0
support/cas-server-support-actions-core/src/main/java/org/apereo/cas/web/flow/login/GenericSuccessViewAction.java