private ModelAndView handleProfileRequest(final HttpServletResponse response, final HttpServletRequest request) throws Throwable {
        val authnContext = retrieveAuthenticationRequest(response, request);

        val ticket = request.getParameter(CasProtocolConstants.PARAMETER_TICKET);
        if (StringUtils.isBlank(ticket) && authnContext.getKey() instanceof final AuthnRequest authnRequest
            && Boolean.FALSE.equals(authnRequest.isPassive())) {
            LOGGER.error("Can not validate the request because no [{}] is provided via the request", CasProtocolConstants.PARAMETER_TICKET);
            return WebUtils.produceErrorView(new IllegalArgumentException("Unable to handle SAML request"));
        }

        val authenticationContext = buildAuthenticationContextPair(request, response, authnContext);
        val assertion = validateRequestAndBuildCasAssertion(response, request, authenticationContext);
        val binding = determineProfileBinding(authenticationContext, request);
        if (StringUtils.isBlank(binding)) {
            LOGGER.error("Unable to determine profile binding");
            return WebUtils.produceErrorView(new IllegalArgumentException("Unable to determine profile binding"));
        }
        val resultObject = buildSamlResponse(response, request, authenticationContext, assertion, binding, ticket);
        request.setAttribute(Response.class.getName(), resultObject);
        return null;
    }
Handle callback profile request.

@param response the response
@param request  the request
@return the model and view
@throws Exception the exception
support/cas-server-support-saml-idp-web/src/main/java/org/apereo/cas/support/saml/web/idp/profile/sso/SSOSamlIdPProfileCallbackHandlerController.java