concrete/src/Api/OAuth/Controller.php
public function handleAuthorizeClient(AuthorizationRequest $request)
    {
        $error = new ErrorList();
        $client = $request->getClient();

        while ($this->request->getMethod() === 'POST') {

            if (!$this->token->validate('oauth_authorize_' . $client->getClientKey())) {
                $error->add($this->token->getErrorMessage());
                break;
            }

            $query = $this->request->getParsedBody();
            $authorized = array_get($query, 'authorize_client');
            $consentType = $this->getConsentType($request);

            // User authorized the request
            if ($consentType === Client::CONSENT_NONE || $authorized) {
                $request->setAuthorizationApproved(true);
                $this->storeRequest($request);

                return new \RedirectResponse($this->request->getUri());
            }

            break;
        }

        $contents = $this->createLoginView([
            'error' => $error,
            'auth' => $request,
            'request' => $this->request,
            'client' => $request->getClient(),
            'authorize' => true,
        ]);

        return new \Concrete\Core\Http\Response($contents->render());
    }
public function handleAuthorizeClient(AuthorizationRequest $request)
    {
        $error = new ErrorList();
        $client = $request->getClient();

        while ($this->request->getMethod() === 'POST') {

            if (!$this->token->validate('oauth_authorize_' . $client->getClientKey())) {
                $error->add($this->token->getErrorMessage());
                break;
            }

            $query = $this->request->getParsedBody();
            $authorized = array_get($query, 'authorize_client');
            $consentType = $this->getConsentType($request);

            // User authorized the request
            if ($consentType === Client::CONSENT_NONE || $authorized) {
                $request->setAuthorizationApproved(true);
                $this->storeRequest($request);

                return new \RedirectResponse($this->request->getUri());
            }

            break;
        }

        $contents = $this->createLoginView([
            'error' => $error,
            'auth' => $request,
            'request' => $this->request,
            'client' => $request->getClient(),
            'authorize' => true,
        ]);

        return new \Concrete\Core\Http\Response($contents->render());
    }
public function handleAuthorizeClient ( AuthorizationRequest $ request ) { $ error = new ErrorList ( ) ; $ client = $ request -> getClient ( ) ; while ( $ this -> request -> getMethod ( ) === 'POST' ) { if ( ! $ this -> token -> validate ( 'oauth_authorize_' . $ client -> getClientKey ( ) ) ) { $ error -> add ( $ this -> token -> getErrorMessage ( ) ) ; break ; } $ query = $ this -> request -> getParsedBody ( ) ; $ authorized = array_get ( $ query , 'authorize_client' ) ; $ consentType = $ this -> getConsentType ( $ request ) ; // User authorized the request if ( $ consentType === Client :: CONSENT_NONE || $ authorized ) { $ request -> setAuthorizationApproved ( true ) ; $ this -> storeRequest ( $ request ) ; return new \ RedirectResponse ( $ this -> request -> getUri ( ) ) ; } break ; } $ contents = $ this -> createLoginView ( [ 'error' => $ error , 'auth' => $ request , 'request' => $ this -> request , 'client' => $ request -> getClient ( ) , 'authorize' => true , ] ) ; return new \ Concrete \ Core \ Http \ Response ( $ contents -> render ( ) ) ; }
Handle the scope authorization portion of an authorization request
This method renders a view that outputs a list of scopes and asks the user to verify that they want to give the
client the access that is being requested.

@param \League\OAuth2\Server\RequestTypes\AuthorizationRequest $request

@return \Concrete\Core\Http\Response|\RedirectResponse
@throws \League\OAuth2\Server\Exception\OAuthServerException
Handle the scope authorization portion of an authorization request This method renders a view that outputs a list of scopes and asks the user to verify that they want to give the client the access that is being requested .