Skip to content

Instantly share code, notes, and snippets.

@qetzal
Created August 1, 2011 17:48
Show Gist options
  • Save qetzal/1118622 to your computer and use it in GitHub Desktop.
Save qetzal/1118622 to your computer and use it in GitHub Desktop.
PHP SSO example
<?php
$sso_secret = "TEST";
$message = base64_encode("{appId:'123',userId:'234',profile:{email:'test@example.com'}}");
$timestamp = time();
$hmac = hash_hmac('sha1', "$message $timestamp", $sso_secret);
echo "<script> var ecwid_sso_profile = '$message $hmac $timestamp' </script>";
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment