Hmm still can't get it to work haha. I can't find anything wrong either...
<?php
$remote_signature = $_GET['oauth_signature'];
$url = strtolower('http://xxxxxxxx.xxxxxx.xx/xxxxxxxxxxxxx/authenticate.php');
unset($_GET['oauth_signature']);
ksort($_GET);
$base_string = 'GET&'.
urlencode($url).'&'.
urlencode(http_build_query($_GET));
$secret = '80............................................d&';
$local_signature = base64_encode(hash_hmac("sha1", $base_string, $secret, TRUE));
if ($remote_signature == $local_signature)
{
session_start();
$_SESSION['authenticated']=true;
echo 'http://xxxxxxxx.xxxxxx.xx/xxxxxxxxxxxxx/index.php';
}
else
{
echo 'http://xxxxxxxx.xxxxxx.xx/xxxxxxxxxxxxx/index.php';
}
?>
<iframe id="msiframe" name="msiframe" src="" height="1000" width="790" frameborder="0"></iframe>
<script type="text/javascript">
var serverURL='http://xxxxxxxx.xxxxxx.xx/xxxxxxxxxxxxx/authenticate.php';
function init() {
var params = {};
params[gadgets.io.RequestParameters.AUTHORIZATION] = gadgets.io.AuthorizationType.SIGNED;
gadgets.io.makeRequest('http://xxxxxxxx.xxxxxx.xx/xxxxxxxxxxxxx/authenticate.php', loadiframe, params);
}
function loadiframe(targetURL) { frames['msiframe'].location.href = targetURL.text; }
init();
</script>
I have checked and double checked for any typos or errors and can't find anything wrong. Any ideas?