user6889084
user6889084

Reputation:

WooCommerce REST Authentication Error

CORS .htaccess

header set Access-Control-Allow-Origin "*"
header set Access-Control-Allow-Headers "origin,content-type,user-agent, accept, x-r$"
header set Access-Control-Allow-Methods "PUT,GET,POST,DELETE,OPTIONS,HEAD"

API Request

http://192.168.1.125/badlapur/wp-json/wc/v2/orders?oauth_consumer_key=ck_fe1859072d41b36ed511ba6a4e31de75aac16516&oauth_nonce=I7DfkcQvMIST8aKnGqSEHk2NsCKTljWs&oauth_signature_method=HMAC-SHA256&oauth_timestamp=1515179933&oauth_version=1.0&oauth_signature=Ru3%2BDd1zz1ihRqGhbeoYasbLZkzNGZqtb5I61UJi1Kw%3D

Json Response

{
"code": "woocommerce_rest_authentication_error",
"message": "Invalid signature - provided signature does not match.",
   "data": {
      "status": 401
   }
}

I am using wordpress with following plugins

  1. JSON API
  2. JSON API USER
  3. WooCommerce

I activated Settings->JSON API->Core & User I re-created consumer key & secret

But still not working, any way to solve?

Upvotes: 1

Views: 1303

Answers (1)

user6889084
user6889084

Reputation:

Finally after researching on various issues from git came to a solution:

  1. Switch over SSL & Upload on your server
  2. If you are on Localhost then setup SSL locally
  3. URL Encoding (I am not clear myself)

I used the 1st method, and it's work flawlessly!

Upvotes: 1

Related Questions