You are here

protected function DisqusCommentManager::ssoKeyEncode in Disqus 8

Assembles the full private key for use in SSO authentication.

Parameters

array $data: An array contating data.

Return value

string The String containing message, timestamp.

1 call to DisqusCommentManager::ssoKeyEncode()
DisqusCommentManager::ssoSettings in src/DisqusCommentManager.php
Computes the full settings associated with Disqus SSO.

File

src/DisqusCommentManager.php, line 157

Class

DisqusCommentManager
It contains common functions to manage disqus_comment fields.

Namespace

Drupal\disqus

Code

protected function ssoKeyEncode(array $data) {

  // Encode the data to be sent off to Disqus.
  $message = base64_encode(json_encode($data));
  $timestamp = time();
  $hmac = hash_hmac('sha1', "{$message} {$timestamp}", $this->configFactory
    ->get('disqus.settings')
    ->get('advanced.disqus_secretkey'));
  return "{$message} {$hmac} {$timestamp}";
}