all. an issue about google oauth, the output url always return signature_invalid . I have no idea.

<?php
$url="https://www.google.com/accounts/OAuthGetRequestToken?";

$scope ="scope=".urlencode(sprintf("https://www.google.com/calendar/feeds/%s/settings",urlencode("[email protected]")));
$oauth_consumer_key="&oauth_consumer_key=anonymous";
$oauth_nonce="&oauth_nonce=1111111111111111111111111111111111111111111111111111111111111111";
$oauth_signature_method=sprintf("&oauth_signature_method=%s","HMAC-SHA1");
$oauth_timestamp=sprintf("&oauth_timestamp=%s",time());
$oauth_signature="&oauth_signature=";


$base_string = $scope.$oauth_consumer_key.$oauth_nonce.$oauth_signature_method.$oauth_timestamp;

$call=$url.$base_string;

$call=$call.$oauth_signature.base64_encode(hash_hmac("sha1",urlencode($base_string),"anonymous",true));

echo $call."\n";
/* file_get_contents($call); */


?>

I reference http://oauth.net/core/1.0/#rfc.section.9.1.1 and http://code.google.com/intl/zh-TW/apis/accounts/docs/OAuth_ref.html#RequestToken

link

feedback

1 Answer

up vote 0 down vote accepted

ok,I find some people's answer.

at PHP Oauth signature_invalid

I can get the correct result. but need to check where is wrong in my code.

link
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.