src/ResponseType/AbstractResponseTypeHandler.php
protected function checkClientId(Request $request)
    {
        // client_id is required and in valid format.
        $clientId = $request->query->get('client_id');
        $errors = $this->validator->validate($clientId, [
            new \Symfony\Component\Validator\Constraints\NotBlank(),
            new \AuthBucket\OAuth2\Symfony\Component\Validator\Constraints\ClientId(),
        ]);
        if (count($errors) > 0) {
            throw new InvalidRequestException([
                'error_description' => 'The request includes an invalid parameter value.',
            ]);
        }

        // Compare client_id with database record.
        $clientManager = $this->modelManagerFactory->getModelManager('client');
        $result = $clientManager->readModelOneBy([
            'clientId' => $clientId,
        ]);
        if ($result === null) {
            throw new UnauthorizedClientException([
                'error_description' => 'The client is not authorized.',
            ]);
        }

        return $clientId;
    }
protected function checkClientId(Request $request)
    {
        // client_id is required and in valid format.
        $clientId = $request->query->get('client_id');
        $errors = $this->validator->validate($clientId, [
            new \Symfony\Component\Validator\Constraints\NotBlank(),
            new \AuthBucket\OAuth2\Symfony\Component\Validator\Constraints\ClientId(),
        ]);
        if (count($errors) > 0) {
            throw new InvalidRequestException([
                'error_description' => 'The request includes an invalid parameter value.',
            ]);
        }

        // Compare client_id with database record.
        $clientManager = $this->modelManagerFactory->getModelManager('client');
        $result = $clientManager->readModelOneBy([
            'clientId' => $clientId,
        ]);
        if ($result === null) {
            throw new UnauthorizedClientException([
                'error_description' => 'The client is not authorized.',
            ]);
        }

        return $clientId;
    }
protected function checkClientId ( Request $ request ) { // client_id is required and in valid format. $ clientId = $ request -> query -> get ( 'client_id' ) ; $ errors = $ this -> validator -> validate ( $ clientId , [ new \ Symfony \ Component \ Validator \ Constraints \ NotBlank ( ) , new \ AuthBucket \ OAuth2 \ Symfony \ Component \ Validator \ Constraints \ ClientId ( ) , ] ) ; if ( count ( $ errors ) > 0 ) { throw new InvalidRequestException ( [ 'error_description' => 'The request includes an invalid parameter value.' , ] ) ; } // Compare client_id with database record. $ clientManager = $ this -> modelManagerFactory -> getModelManager ( 'client' ) ; $ result = $ clientManager -> readModelOneBy ( [ 'clientId' => $ clientId , ] ) ; if ( $ result === null ) { throw new UnauthorizedClientException ( [ 'error_description' => 'The client is not authorized.' , ] ) ; } return $ clientId ; }
Fetch cliend_id from GET.

@param Request $request Incoming request object

@return string Supplied client_id from incoming request

@throw InvalidRequestException If supplied client_id in bad format.
@throw UnauthorizedClientException If client_id not found from database record.
Fetch cliend_id from GET .