WooCommerce REST 身份验证错误

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请求

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 回应

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

我正在使用带有以下插件的 wordpress

  1. JSON API
  2. JSON API 用户
  3. WooCommerce

我激活了设置->JSON API->核心和用户 我重新创建了消费者密钥和秘密

还是不行,有什么办法解决吗?

在研究了 git 的各种问题后终于找到了解决方案:

  1. 切换到 SSL 并在您的服务器上上传
  2. 如果您在本地主机上,则在本地设置 SSL
  3. URL编码(我自己也不清楚)

我用的是第一种方法,完美无缺!