Skip to content

Instantly share code, notes, and snippets.

@rmruano
Created February 17, 2013 13:41
Show Gist options
  • Select an option

  • Save rmruano/4971537 to your computer and use it in GitHub Desktop.

Select an option

Save rmruano/4971537 to your computer and use it in GitHub Desktop.
Miniplay S2S API: Signature validation for server 2 server callbacks (PHP)
$json = file_get_contents("php://input"); /* Get the RAW POST DATA */
if ( ! ( isset($_SERVER['HTTP_MINI_SIGNATURE'])
&& $_SERVER['HTTP_MINI_SIGNATURE'] == md5("[YOUR_API_KEY]".$json) )) {
throw new Exception("Invalid signature");
}
/* the request signature has been validated! */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment