Hi i am trying to oauth in magento 2 via integration but always getting the following response :
Array ( [oauth_problem] => The signature is invalid. Verify and try again. )
I am using following code to generate signature
$request_headers = [
"oauth_callback"=> urlencode(route('magento',['param'=>'getkeys'])),
"oauth_consumer_key" => urlencode("rgwwj37w5n0**********601inp"),
"oauth_nonce" => urlencode(md5(rand())),
"oauth_signature_method"=>urlencode("HMAC-SHA1"),
"oauth_timestamp" => urlencode(time()),
"oauth_version" =>urlencode("1.0"),
];
$key = "xv2dhhz7**********u8z8q21wrpo&";
$request_headers["oauth_signature"] = $key;
$singature = urlencode(base64_encode(hash_hmac('sha1',urlencode("POST&").http_build_query($request_headers),$key,true)));
Thanks in advance.
Hello @tarun_abc
Are you using older version of Magento?
Check this link.
As you didn't mention error code here is the list to get idea about
https://devdocs.magento.com/guides/v2.3/get-started/authentication/oauth-errors.html
@theMageComp
I am using Magento 2.3 and getting only this as a response
Endpoint - oauth/token/request
Array ( [oauth_problem] => The signature is invalid. Verify and try again. )