public function authenticate(IRequest $request)
    {
        $id = $request->request('client_id');
        $secret = $request->request('client_secret');

        if (!$id) {
            throw new InvalidClientException('Client id is missing.');
        }

        if (!$client = $this->clientStorage->get($id)) {
            throw new InvalidClientException('Invalid client credentials.');
        }

        if ((string) $secret !== (string) $client->getSecret()) {
            throw new InvalidClientException('Invalid client credentials.');
        }

        return $client;
    }
public function authenticate(IRequest $request)
    {
        $id = $request->request('client_id');
        $secret = $request->request('client_secret');

        if (!$id) {
            throw new InvalidClientException('Client id is missing.');
        }

        if (!$client = $this->clientStorage->get($id)) {
            throw new InvalidClientException('Invalid client credentials.');
        }

        if ((string) $secret !== (string) $client->getSecret()) {
            throw new InvalidClientException('Invalid client credentials.');
        }

        return $client;
    }
public function authenticate ( IRequest $ request ) { $ id = $ request -> request ( 'client_id' ) ; $ secret = $ request -> request ( 'client_secret' ) ; if ( ! $ id ) { throw new InvalidClientException ( 'Client id is missing.' ) ; } if ( ! $ client = $ this -> clientStorage -> get ( $ id ) ) { throw new InvalidClientException ( 'Invalid client credentials.' ) ; } if ( ( string ) $ secret !== ( string ) $ client -> getSecret ( ) ) { throw new InvalidClientException ( 'Invalid client credentials.' ) ; } return $ client ; }
Authenticates client and returns it

@param IRequest $request

@return IClient
@throws InvalidClientException
Authenticates client and returns it