@PostMapping(path = SamlIdPConstants.ENDPOINT_SAML2_IDP_ECP_PROFILE_SSO,
        consumes = {MediaType.TEXT_XML_VALUE, SamlIdPConstants.ECP_SOAP_PAOS_CONTENT_TYPE},
        produces = {MediaType.TEXT_XML_VALUE, SamlIdPConstants.ECP_SOAP_PAOS_CONTENT_TYPE})
    @Operation(summary = "Handle SAML ECP request")
    public void handleEcpRequest(final HttpServletResponse response,
                                 final HttpServletRequest request) throws Exception {
        val soapContext = decodeSoapRequest(request);
        val credential = extractBasicAuthenticationCredential(request);

        if (credential == null) {
            LOGGER.error("Credentials could not be extracted from the SAML ECP request");
            response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
            return;
        }
        if (soapContext == null) {
            LOGGER.error("SAML ECP request could not be determined from the authentication request");
            return;
        }
        val buildContext = SamlProfileBuilderContext.builder()
            .httpRequest(request)
            .httpResponse(response)
            .binding(SAMLConstants.SAML2_PAOS_BINDING_URI)
            .messageContext(soapContext)
            .build();
        handleEcpRequest(buildContext, credential);
    }
Handle ecp request.

@param response the response
@param request  the request
@throws Exception the exception
support/cas-server-support-saml-idp-web/src/main/java/org/apereo/cas/support/saml/web/idp/profile/ecp/ECPSamlIdPProfileHandlerController.java