private static String readRequestBodyIfAny(final HttpServletRequest request) {
        try (val reader = request.getReader()) {
            return reader.lines().collect(Collectors.joining(" "));
        } catch (final Exception e) {
            LOGGER.trace("Could not obtain the saml request body from the http request", e);
        }
        return null;
    }
Gets the request body from the request.

@param request the request
@return the request body
support/cas-server-support-saml-core-api/src/main/java/org/apereo/cas/support/saml/authentication/principal/SamlServiceFactory.java