public static Map<String, String> getHttpRequestParametersFromRequestBody(final HttpServletRequest httpServletRequest) {
        if (HttpMethod.POST.matches(httpServletRequest.getMethod())
            && StringUtils.equalsIgnoreCase(httpServletRequest.getContentType(), MediaType.APPLICATION_FORM_URLENCODED_VALUE)) {
            try (val is = httpServletRequest.getInputStream()) {
                if (!is.isFinished()) {
                    val requestBody = IOUtils.toString(is, StandardCharsets.UTF_8);
                    val encodedParams = WWWFormCodec.parse(requestBody, StandardCharsets.UTF_8);
                    return encodedParams
                        .stream()
                        .filter(param -> StringUtils.isNotBlank(param.getValue()))
                        .peek(param -> httpServletRequest.setAttribute(param.getName(), param.getValue()))
                        .collect(Collectors.toMap(NameValuePair::getName, NameValuePair::getValue));
                }
            } catch (final Exception e) {
                LoggingUtils.error(LOGGER, e);
            }
        }
        return new HashMap<>();
    }
Gets http request parameters.

@param httpServletRequest the http servlet request
@return the http request parameters from request body
core/cas-server-core-web-api/src/main/java/org/apereo/cas/web/support/WebUtils.java