@Override
    @GetMapping(path = CasProtocolConstants.ENDPOINT_PROXY)
    @Operation(summary = "Proxy authentication endpoint",
        parameters = {
            @Parameter(name = "ticket", in = ParameterIn.QUERY, required = true, description = "Proxy granting ticket"),
            @Parameter(name = "service", in = ParameterIn.QUERY, required = true, description = "Target service")
        })
    public ModelAndView handleRequestInternal(final HttpServletRequest request, final HttpServletResponse response) throws Throwable {
        val proxyGrantingTicket = request.getParameter(CasProtocolConstants.PARAMETER_PROXY_GRANTING_TICKET);
        val targetService = getTargetService(request);
        if (!StringUtils.hasText(proxyGrantingTicket) || targetService == null) {
            return generateErrorView(CasProtocolConstants.ERROR_CODE_INVALID_REQUEST_PROXY, null, request);
        }
        try {
            val proxyTicket = centralAuthenticationService.grantProxyTicket(proxyGrantingTicket, targetService);
            val model = CollectionUtils.wrap(CasProtocolConstants.PARAMETER_TICKET, proxyTicket.getId());
            return new ModelAndView(this.successView, (Map) model);
        } catch (final AbstractTicketException e) {
            return generateErrorView(e.getCode(), new Object[]{proxyGrantingTicket}, request);
        } catch (final UnauthorizedServiceException e) {
            return generateErrorView(CasProtocolConstants.ERROR_CODE_UNAUTHORIZED_SERVICE_PROXY, new Object[]{targetService.getId()}, request);
        }
    }
The view to redirect to on a validation failure.
support/cas-server-support-validation-core/src/main/java/org/apereo/cas/web/v2/ProxyController.java