You are here

private function DataApi::getAuthHeader in Acquia Lift Connector 8

Returns a string to use for the 'Authorization' header.

Return value

string

3 calls to DataApi::getAuthHeader()
DataApi::deleteEvent in src/Service/Api/DataApi.php
Deletes an event from Acquia Lift Data
DataApi::getSegments in src/Service/Api/DataApi.php
Fetches the available Segment IDs from Acquia Lift
DataApi::saveEvent in src/Service/Api/DataApi.php
Saves an event to Acquia Lift Data

File

src/Service/Api/DataApi.php, line 165
Contains \Drupal\acquia_lift\Service\Api\DataApi.

Class

DataApi

Namespace

Drupal\acquia_lift\Service\Api

Code

private function getAuthHeader($method, $path, $parameters = [], $headers = []) {
  $canonical = $this
    ->canonicalizeRequest($method, $path, $parameters, $headers);
  $hmac = base64_encode(hash_hmac('sha1', (string) $canonical, $this->credentialSettings['secret_key'], TRUE));
  return 'HMAC ' . $this->credentialSettings['access_key'] . ':' . $hmac;
}