@GetMapping(path = OAuth20Constants.BASE_OAUTH20_URL + '/' + OAuth20Constants.CALLBACK_AUTHORIZE_URL)
    @Operation(summary = "Handle OAuth callback authorize request", hidden = true)
    public ModelAndView handleRequest(final HttpServletRequest request, final HttpServletResponse response) {
        ensureSessionReplicationIsAutoconfiguredIfNeedBe(request);

        val callback = new OAuth20CallbackLogic();
        val context = new JEEContext(request, response);
        String defaultUrl = null;
        val clientId = context.getRequestParameter(OAuth20Constants.CLIENT_ID);
        val redirectUri = context.getRequestParameter(OAuth20Constants.REDIRECT_URI);
        if (clientId.isPresent() && redirectUri.isPresent()) {
            val servicesManager = getConfigurationContext().getServicesManager();
            val serviceClient = OAuth20Utils.getRegisteredOAuthServiceByClientId(servicesManager, clientId.get());
            if (serviceClient != null && serviceClient.matches(redirectUri.get())) {
                defaultUrl = redirectUri.get();
            }
        }
        callback.perform(getConfigurationContext().getOauthConfig(),
            defaultUrl, Boolean.FALSE, Authenticators.CAS_OAUTH_CLIENT,
            new JEEFrameworkParameters(request, response));
        val url = callback.getRedirectUrl();
        val manager = new ProfileManager(context, getConfigurationContext().getSessionStore());
        LOGGER.trace("OAuth callback URL is [{}]", url);
        return getConfigurationContext().getCallbackAuthorizeViewResolver().resolve(context, manager, url);
    }
Handle request.

@param request  the request
@param response the response
@return the model and view
support/cas-server-support-oauth-core-api/src/main/java/org/apereo/cas/support/oauth/web/endpoints/OAuth20CallbackAuthorizeEndpointController.java