OPEN-DSI / ecommerceng_woosync

WooSync, synchronize Woocommerce and Dolibarr
GNU General Public License v3.0
71 stars 46 forks source link

Invalid signature - provided signature does not match when using OAuth1 #94

Open madmaxpt opened 1 year ago

madmaxpt commented 1 year ago

When synchronising a product with Woocommerce using OAuth1, we encounter an error "Invalid signature - provided signature does not match"

Woosync uses the default value of the OAuth1 client (https://github.com/OPEN-DSI/ecommerceng_woosync/blob/2022.5.3/class/client/eCommerceClientWooCommerceApi.class.php#L85) which does not include the POST parameters in the request signature (https://github.com/OPEN-DSI/ecommerceng_woosync/blob/2022.5.3/includes/oauth-subscriber-woocommerce/src/Oauth1.php#L69).

However, Woocommerce expects them (https://github.com/woocommerce/woocommerce/blob/trunk/plugins/woocommerce/includes/class-wc-rest-authentication.php#L270)

Note that always setting the parameter to true won't solve the problem because Woocommerce doesn't expect PUT parameters in method serialization.