protected Map<String, List> extractQueryParameters(final Service service) {
        val attributes = new LinkedHashMap<String, List>();
        if (service instanceof final WebApplicationService webApplicationService) {
            val originalUrl = webApplicationService.getOriginalUrl();
            try {
                if (urlValidator.isValid(originalUrl)) {
                    val queryParams = FunctionUtils.doUnchecked(() -> new URIBuilder(originalUrl).getQueryParams());
                    queryParams.forEach(pair -> {
                        val values = CollectionUtils.wrapArrayList(StringEscapeUtils.escapeHtml4(pair.getValue()));
                        attributes.put(pair.getName(), values);
                    });
                }
            } catch (final Exception e) {
                LOGGER.error("Unable to extract query parameters from [{}]: [{}]", originalUrl, e.getMessage());
            }
        }
        return attributes;
    }
Cleanup the url. Removes jsession ids and query strings.

@param url the url
@return sanitized url.
core/cas-server-core-services-authentication/src/main/java/org/apereo/cas/authentication/principal/AbstractServiceFactory.java