MySpace Application Development

From ZeroPain's Wiki

Jump to: navigation, search

[edit] Code Snippets

[edit] PHP

[edit] IFrame OAuth Verifying

$this_url = strtolower('http://??????????????.com/');
$myspace_secret = "????????????????";
$opensocial_viewer_id = $_GET['opensocial_viewer_id'];
$remote_signature = $_GET['oauth_signature'];
unset($_GET['oauth_signature']);
ksort($_GET);
$local_signature = base64_encode(hash_hmac("sha1", "GET&".urlencode($this_url)."&".str_replace('%2B', '%2520', urlencode(http_build_query($_GET, null, '&'))), "$myspace_secret&", TRUE));
if ($remote_signature == $local_signature) {
	// Verified Do This
} else {
	// Not Verified
}
Personal tools
Google AdSense