public static <T extends RequestAbstractType> T convertToSamlObject(final OpenSamlConfigBean openSamlConfigBean,
                                                                        final String requestValue, final Class<T> clazz) {
        try {
            LOGGER.trace("Retrieving SAML request from [{}]", requestValue);
            val decodedBytes = Base64Support.decode(requestValue);
            try (val is = new InflaterInputStream(new ByteArrayInputStream(decodedBytes), new Inflater(true))) {
                return clazz.cast(XMLObjectSupport.unmarshallFromInputStream(openSamlConfigBean.getParserPool(), is));
            }
        } catch (final Throwable e) {
            return FunctionUtils.doUnchecked(() -> {
                val encodedRequest = EncodingUtils.decodeBase64(requestValue.getBytes(StandardCharsets.UTF_8));
                try (val is = new ByteArrayInputStream(encodedRequest)) {
                    return clazz.cast(XMLObjectSupport.unmarshallFromInputStream(openSamlConfigBean.getParserPool(), is));
                }
            });
        }
    }
Convert to saml object.

@param <T>                the type parameter
@param openSamlConfigBean the open saml config bean
@param requestValue       the request value
@param clazz              the clazz
@return the final xml object
support/cas-server-support-saml-core-api/src/main/java/org/apereo/cas/support/saml/SamlUtils.java