@Override
    public <T> Optional<T> resolveRequestParameter(final WebContext context,
                                                   final String name,
                                                   final Class<T> clazz) {
        val supported = jwtBuilder.getCasProperties().getAuthn().getOidc().getDiscovery().isRequestParameterSupported();
        return context.getRequestParameter(OAuth20Constants.REQUEST)
            .filter(parameterValue -> supported)
            .map(Unchecked.function(jwtRequest -> resolveJwtRequestParameter(context, jwtRequest, name, clazz)))
            .or(() -> {
                val values = context.getRequestParameters().get(name);
                if (values != null && values.length > 0) {
                    if (clazz.isArray()) {
                        return Optional.of(clazz.cast(values));
                    }
                    if (Collection.class.isAssignableFrom(clazz)) {
                        return Optional.of(clazz.cast(CollectionUtils.wrapArrayList(values)));
                    }
                    val singleValue = EncodingUtils.urlDecode(values[0]);
                    if (Long.class.isAssignableFrom(clazz)){
                        return Optional.ofNullable(singleValue).map(Long::parseLong).map(clazz::cast);
                    }
                    if (Integer.class.isAssignableFrom(clazz)){
                        return Optional.ofNullable(singleValue).map(Integer::parseInt).map(clazz::cast);
                    }
                    if (Double.class.isAssignableFrom(clazz)){
                        return Optional.ofNullable(singleValue).map(Double::parseDouble).map(clazz::cast);
                    }
                    return Optional.ofNullable(singleValue).map(clazz::cast);
                }
                return Optional.empty();
            });
    }
This is {@link DefaultOAuth20RequestParameterResolver}.

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