You are here

protected function SearchSubscriber::authenticateResponse in Acquia Connector 8

Validate the hmac for the response body.

Parameters

\Solarium\Core\Client\Response $response: Solarium Response.

string $nonce: Nonce.

string $url: Url.

Return value

\Solarium\Core\Client\Response Solarium Response.

Throws

\Solarium\Exception\HttpException

1 call to SearchSubscriber::authenticateResponse()
SearchSubscriber::postExecuteRequest in acquia_search/src/EventSubscriber/SearchSubscriber.php
Validate response.

File

acquia_search/src/EventSubscriber/SearchSubscriber.php, line 138

Class

SearchSubscriber
Extends Solarium plugin: authenticate, etc.

Namespace

Drupal\acquia_search\EventSubscriber

Code

protected function authenticateResponse(Response $response, $nonce, $url) {
  $hmac = $this
    ->extractHmac($response
    ->getHeaders());
  if (!$this
    ->validateResponse($hmac, $nonce, $response
    ->getBody())) {
    throw new HttpException('Authentication of search content failed url: ' . $url);
  }
  return $response;
}