static String toRedirectionUrl(SAMLObject msg,
                                   String endpointUrl,
                                   String messageParamName,
                                   Credential signingCredential,
                                   String signatureAlgorithm,
                                   @Nullable String relayState) {
        requireNonNull(msg, "msg");
        requireNonNull(endpointUrl, "endpointUrl");
        requireNonNull(messageParamName, "messageParamName");
        requireNonNull(signingCredential, "signingCredential");
        requireNonNull(signatureAlgorithm, "signatureAlgorithm");

        final QueryParamsBuilder params = QueryParams.builder();
        params.add(messageParamName, toDeflatedBase64(msg));

        if (relayState != null) {
            // RelayState data MAY be included with a SAML protocol message transmitted with this binding.
            // The value MUST NOT exceed 80 bytes in length and SHOULD be integrity protected by the entity
            // creating the message independent of any other protections that may or may not exist
            // during message transmission.
            if (relayState.length() > 80) {
                throw new IllegalArgumentException("too long relayState string: " + relayState.length());
            }
            params.add(RELAY_STATE, relayState);
        }

        params.add(SIGNATURE_ALGORITHM, signatureAlgorithm);

        // Use URL-encoded query string as input.
        final String input = params.toQueryString();
        final String output = generateSignature(signingCredential, signatureAlgorithm, input);
        params.add(SIGNATURE, output);

        return endpointUrl + '?' + params.toQueryString();
    }
Returns a redirected URL which includes a deflated base64 string that is converted from the specified
{@link SAMLObject}. The URL must contain a signature of the generated query string.
saml/src/main/java/com/linecorp/armeria/server/saml/HttpRedirectBindingUtil.java