@Override
    public String compute(final String url, final WebContext context) {
        if (!url.startsWith(callbackUrl)) {
            return url;
        }

        return FunctionUtils.doUnchecked(() -> {
            val builder = new URIBuilder(url);
            val includeParameterNames = getIncludeParameterNames();
            includeParameterNames.forEach(param -> addUrlParameter(context, builder, param));

            val existingParameters = new HashMap<>(context.getRequestParameters());
            includeParameterNames.forEach(existingParameters.keySet()::remove);
            existingParameters.keySet().removeAll(getExcludedParameterNames());
            existingParameters
                .entrySet()
                .stream()
                .filter(entry -> entry.getValue().length > 0)
                .forEach(entry -> builder.addParameter(entry.getKey(), entry.getValue()[0]));

            val callbackResolved = builder.build().toString();
            LOGGER.debug("Final resolved callback URL is [{}]", callbackResolved);
            return callbackResolved;
        });
    }
This is {@link OAuth20CasCallbackUrlResolver}.

@author Misagh Moayyed
@since 5.1.0
support/cas-server-support-oauth-core-api/src/main/java/org/apereo/cas/support/oauth/web/OAuth20CasCallbackUrlResolver.java