This chunk of PHP (originally posted by CrushSpot) verifies callback urls for me:
<?php
$remote_signature = $_GET['oauth_signature'];
$url = strtolower('http://myserver.net/uri_to_this_script.php');
unset($_GET['oauth_signature']);
ksort($_GET);
$base_string = 'GET&'.
urlencode($url).'&'.
urlencode(http_build_query($_GET));
$secret = 'security_key'.'&';
$local_signature = base64_encode(hash_hmac("sha1", $base_string, $secret, TRUE));
if ($remote_signature == $local_signature) {
$fh = fopen("cb_output.txt", 'w');
fwrite($fh, "Authenticationed!\n");
fclose($fh);
} else {
$fh = fopen("cb_output.txt", 'w');
fwrite($fh, "Authentication FAILED!\n");
fwrite($fh, "Remote Sig: ".$remote_signature."\n");
fwrite($fh, "Local Sig: ".$local_signature."\n");
fclose($fh);
}
?>
What it does is write to a file, 'cb_output.txt', whether or not the ping authenticated. Obviously, that's not going to work long term, but it does for a simple test.
Two notes:
$url needs to be set to the URL of the file, and needs to match what you set the Callback URL to precisely.
$secret needs to be set to the Security Key of the calling App, and it needs an '&' appended to the end.
Now, as far as this:
It appears that apps are using this mechanism to credit users for referrals. They attach a "userid_to_credit" parameter to the end of their install URL. I assume that the "userid_to_credit" is passed to the Install Callback URL.
I've never seen this work. If you have a link to the App that does this, cool, 'cause I'd like to see what they're doing. This sort of functionality has been requested by a fair number of users in the Suggestions forums, and that tells me its not implemented. Maybe the App designers are hoping and planning ahead, 'cause no parameters from the referring Profile URL get passed along to the Callback URL that I've seen.