private Optional<NameValuePair> getQueryParameter(final WebContext context, final String name) {
        val value = requestParameterResolver.resolveRequestParameter(context, name)
            .or(Unchecked.supplier(() -> {
                val builderContext = new URIBuilder(context.getFullRequestURL());
                return builderContext.getQueryParams()
                    .stream()
                    .filter(p -> p.getName().equalsIgnoreCase(name))
                    .map(NameValuePair::getValue)
                    .findFirst();
            }));
        return value.map(v -> new BasicNameValuePair(name, v));
    }
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