AnsweredAssumed Answered

[PHP] Creating Oauth_signature failed

Question asked by 皇登攀 Huang Dengpan on Nov 1, 2016
Latest reply on Nov 2, 2016 by Garth Egbert

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:

Outcomes