Open Rajags opened 7 years ago
Hi @Rajags, I had the same problem. I tried requests-oauthlib, which seems to be more maintained, but it's happening there too. I could debug it for rauth. The problem is described in this comment https://github.com/requests/requests-oauthlib/issues/257#issuecomment-1161743797
As a workaround, I did an override of SignatureMethod::_normalize_request_parameters()
def _normalize_request_parameters(self, oauth_params, req_kwargs):
"""
This is a workaroud. Rauth do encode a space in params as + in the query string and as %20 for the
signature. On the server side, the Zend Framework computes the signature from the query string with space
encoded as +. This leads to a signature mismatch.
"""
original_response = super()._normalize_request_parameters(oauth_params, req_kwargs)
return original_response.replace('%20', '%2B')
Note that for magento, the signature algorithm must also be adapted to use HmacSha256.
<?php
$params = array( 'siteUrl' => $oauthbaseurl, 'requestTokenUrl' => $requestTokenUrl, 'accessTokenUrl' => $accessTokenUrl, 'consumerKey' => $consumerkey, 'consumerSecret' => $consumersecret, 'callbackUrl' => $callbackUrl );
$curl = curl_init();
I m getting response like this 8037b72f811ab475bc974b40935248a1 / 0b76eca45b47011b4d51f2f6179ee0f6{"success":true,"verifier":"e793623107ebe3d4e30d2bd2592ed7c9"}oauth_problem=signature_invalid
Please help me anyone why i m getting oauth problem and signature invalid