@Override
    public void doEncode() throws MessageEncodingException {
        this.messageContext = new MessageContext();
        if (request.isSigned()) {
            LOGGER.trace("Request is signed for [{}]", request.getElementQName());
            val signingContext = messageContext.ensureSubcontext(SecurityParametersContext.class);
            val signingParams = new SignatureSigningParameters();
            val signature = request.getSignature();
            signingParams.setSigningCredential(Objects.requireNonNull(signature).getSigningCredential());
            signingParams.setSignatureAlgorithm(signature.getSignatureAlgorithm());
            Objects.requireNonNull(signingContext).setSignatureSigningParameters(signingParams);
        }

        val samlObject = (SAMLObject) request;
        removeSignature(samlObject);
        encodedRequest = deflateAndBase64Encode(samlObject);
        messageContext.setMessage(request);
        FunctionUtils.doIfNotNull(relayState, value -> SAMLBindingSupport.setRelayState(messageContext, value));

        this.redirectUrl = buildRedirectURL(messageContext, endpointUrl, encodedRequest);
        LOGGER.debug("Created redirect URL [{}] based on endpoint [{}]", this.redirectUrl, endpointUrl);
    }
This is {@link SamlIdPHttpRedirectDeflateEncoder}.

@author Misagh Moayyed
@since 6.0.0
support/cas-server-support-saml-idp-web/src/main/java/org/apereo/cas/support/saml/web/idp/profile/slo/SamlIdPHttpRedirectDeflateEncoder.java