woocommerce / wc-api-ruby

A Ruby wrapper for the WooCommerce API.
MIT License
69 stars 73 forks source link

Getting invalid signature error response for valid consumer key/secret #15

Closed homanchou closed 8 years ago

homanchou commented 8 years ago

making GET request over http:

D, [2015-11-30T15:50:17.860010 #34865] DEBUG -- : [httplog] Connecting: test.com:80
D, [2015-11-30T15:50:17.873659 #34865] DEBUG -- : [httplog] Sending: GET http://test.com:80/wc-api/v3/products?oauth_consumer_key=ck_9fd4eaa90e58f9b6035f74540d3032b8d2655d9d&oauth_nonce=e144f03ba198dffa288980cfa4ea0ccc9ce0dcf6&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1448927417&oauth_signature=QxbVO1i0t4mMy%252B3HzxR%252BRdBt%252F90%253D
D, [2015-11-30T15:50:17.873856 #34865] DEBUG -- : [httplog] Header: user-agent: WooCommerce API Client-Ruby/1.0.3
D, [2015-11-30T15:50:17.873961 #34865] DEBUG -- : [httplog] Header: content-type: application/json;charset=utf-8
D, [2015-11-30T15:50:17.874057 #34865] DEBUG -- : [httplog] Header: accept: application/json
D, [2015-11-30T15:50:17.874151 #34865] DEBUG -- : [httplog] Header: connection: close
D, [2015-11-30T15:50:17.874251 #34865] DEBUG -- : [httplog] Data: {}
D, [2015-11-30T15:50:18.167211 #34865] DEBUG -- : [httplog] Status: 401
D, [2015-11-30T15:50:18.167472 #34865] DEBUG -- : [httplog] Benchmark: 0.29283203097293153 seconds
D, [2015-11-30T15:50:18.167937 #34865] DEBUG -- : [httplog] Header: date: Mon, 30 Nov 2015 23:50:17 GMT
D, [2015-11-30T15:50:18.168130 #34865] DEBUG -- : [httplog] Header: server: Apache/2.4.12
D, [2015-11-30T15:50:18.168325 #34865] DEBUG -- : [httplog] Header: x-powered-by: PHP/5.4.43
D, [2015-11-30T15:50:18.168469 #34865] DEBUG -- : [httplog] Header: connection: close
D, [2015-11-30T15:50:18.168630 #34865] DEBUG -- : [httplog] Header: transfer-encoding: chunked
D, [2015-11-30T15:50:18.168754 #34865] DEBUG -- : [httplog] Header: content-type: application/json; charset=UTF-8
D, [2015-11-30T15:50:18.169004 #34865] DEBUG -- : [httplog] Response:
{"errors":[{"code":"woocommerce_api_authentication_error","message":"Invalid Signature - provided signature does not match"}]}

Returns invalid signature error, using latest version of gem.

homanchou commented 8 years ago

Nevermind, figured it out. needed to add 'www' to the url.