You are here

function disqus_sso_key_encode in Disqus 7

Assembles the full private key for use in SSO authentication.

Parameters

array $data:

Return value

string

1 call to disqus_sso_key_encode()
disqus_sso_disqus_settings in ./disqus.module
Computes the full settings associated with Disqus SSO.

File

./disqus.module, line 960
The Disqus Drupal module.

Code

function disqus_sso_key_encode($data) {

  // Encode the data to be sent off to Disqus.
  $message = base64_encode(json_encode($data));
  $timestamp = time();
  $hmac = hash_hmac('sha1', "{$message} {$timestamp}", variable_get('disqus_secretkey', ''));
  return "{$message} {$hmac} {$timestamp}";
}