[PHP] Creating Oauth_signature failed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello, Team
I have a problem on creating Oauth_signature.
Here is my codes, could you help me correct it ? Thank you very much!
$string='GET&'.urlencode('about:blank').'&'.urlencode('oauth_consumer_key='.$_POST['oauth_consumer_key'].'&oauth_nonce='.$_POST['oauth_nonce'].'&oauth_signature_method='.$_POST['oauth_signature_method'].'&oauth_timestamp='.$_POST['oauth_timestamp'].'&oauth_version='.$_POST['oauth_version']);
$oauth_signature= base64_encode(hash_hmac('sha1',$string,"123",TRUE));
$oauth_signature doesn't match with $_POST['oauth_signature']
Here is the params we can get.
$params = array(
'oauth_consumer_key' => $_POST['oauth_consumer_key'],
'oauth_nonce' => $_POST['oauth_nonce'],
'oauth_signature_method' => $_POST['oauth_signature_method'],
'oauth_timestamp' => $_POST['oauth_timestamp'],
'oauth_version' => $_POST['oauth_version']
);
Callback result: