calatonsystems / wc-api-java

Java wrapper for WooCommerce REST API
MIT License
98 stars 77 forks source link

Invalid signature - provided signature does not match #14

Closed redochka closed 5 years ago

redochka commented 5 years ago

Hello

Testing the library locally, i went to woo settings and created the api keys manually and run the very simple test

final String siteUrl  = "http://wp496.wp.me/";
final String username = "ck_87a7fd079cafc0a23032612c6b739ca34cdc4fc4";
final String password = "cs_402939f008f55fae91b88cbd256d6e8c21a52858";

OAuthConfig config = new OAuthConfig(siteUrl, username, password);

WooCommerce wooCommerce = new WooCommerceAPI(config, ApiVersionType.V2);

i get this error:

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

Any clue why such error?

Thanks

redochka commented 5 years ago

Solution: I had to remove the slash from the siteUrl so that it matches the value declared in wordpress → general settings

change:

final String siteUrl  = "http://wp496.wp.me/";

to

final String siteUrl  = "http://wp496.wp.me";