protected URI determineUnauthorizedServiceRedirectUrl(final RequestContext context) {
        val redirectUrl = WebUtils.getUnauthorizedRedirectUrlFromFlowScope(context);
        val currentEvent = context.getCurrentEvent();
        if (currentEvent != null) {
            val eventAttributes = currentEvent.getAttributes();
            LOGGER.debug("Finalizing the unauthorized redirect URL [{}] when processing event [{}] with attributes [{}]",
                redirectUrl, currentEvent.getId(), eventAttributes);
        }
        return redirectUrl;
    }
This is {@link RedirectUnauthorizedServiceUrlAction}.

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