@GetMapping(path = OAuth20Constants.BASE_OAUTH20_URL + '/' + OAuth20Constants.AUTHORIZE_URL)
    @Operation(summary = "Handle OAuth authorization request")
    public ModelAndView handleRequest(final HttpServletRequest request,
                                      final HttpServletResponse response) throws Throwable {
        val requestParameterResolver = getConfigurationContext().getRequestParameterResolver();

        val webContext = new JEEContext(request, response);
        val prompts = requestParameterResolver.resolveSupportedPromptValues(webContext);
        val requestedPrompt = requestParameterResolver.resolveRequestedPromptValues(webContext);
        if (!requestedPrompt.isEmpty() && !requestedPrompt.equals(prompts)) {
            return OAuth20Utils.writeError(response, OAuth20Constants.INVALID_REQUEST, "Unsupported prompt parameter value");
        }
        ensureSessionReplicationIsAutoconfiguredIfNeedBe(request);

        val context = new JEEContext(request, response);
        val manager = new ProfileManager(context, getConfigurationContext().getSessionStore());

        if (context.getRequestAttribute(OAuth20Constants.ERROR).isPresent()) {
            val mv = getConfigurationContext().getOauthInvalidAuthorizationResponseBuilder().build(context);
            if (!mv.isEmpty() && mv.hasView()) {
                return mv;
            }
        }

        val clientId = requestParameterResolver
            .resolveRequestParameter(context, OAuth20Constants.CLIENT_ID)
            .map(String::valueOf)
            .orElse(StringUtils.EMPTY);
        val registeredService = getRegisteredServiceByClientId(clientId);
        val clientService = getConfigurationContext().getWebApplicationServiceServiceFactory().createService(clientId);
        RegisteredServiceAccessStrategyUtils.ensureServiceAccessIsAllowed(clientService, registeredService);

        if (LoggingUtils.isProtocolMessageLoggerEnabled()) {
            val redirectUri = requestParameterResolver.resolveRequestParameter(context, OAuth20Constants.REDIRECT_URI).orElse(StringUtils.EMPTY);
            val responseType = requestParameterResolver.resolveRequestParameter(context, OAuth20Constants.RESPONSE_TYPE).orElse(StringUtils.EMPTY);
            val scopes = requestParameterResolver.resolveRequestParameter(context, OAuth20Constants.SCOPE).orElse(StringUtils.EMPTY);
            val state = requestParameterResolver.resolveRequestParameter(context, OAuth20Constants.STATE).orElse(StringUtils.EMPTY);
            val protocolContext = Map.of("Registered Service", registeredService.getName(), "Client ID", clientId, "State", state,
                "Redirect URI", redirectUri, "Response Type", responseType, "Scopes", scopes);
            LoggingUtils.protocolMessage("OAuth/OpenID Connect Authorization Request", protocolContext);
            configurationContext.getApplicationContext().publishEvent(
                new OAuth20AuthorizationRequestEvent(this, ClientInfoHolder.getClientInfo(), protocolContext));
        }

        if (isRequestAuthenticated(manager, context, registeredService)) {
            val mv = getConfigurationContext().getConsentApprovalViewResolver().resolve(context, registeredService);
            if (!mv.isEmpty() && mv.hasView()) {
                LOGGER.debug("Redirecting to consent-approval view with model [{}]", mv.getModel());
                return mv;
            }
        }

        return redirectToCallbackRedirectUrl(manager, registeredService, context);
    }
Handle request via GET.

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