Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rest authentication error : Invalid signature - provided signature does not match #61

Open
nmsobri opened this issue Jul 27, 2017 · 0 comments

Comments

@nmsobri
Copy link

nmsobri commented Jul 27, 2017

$stack = HandlerStack::create();

$middleware = new Oauth1( array(
		'consumer_key' => $user_info['consumer_key'],
		'consumer_secret' => $user_info['consumer_secret'],
		'signature_method' => Oauth1::SIGNATURE_METHOD_HMAC,
		'token' => '', 'token_secret' => ''
	)
);

$stack->push( $middleware );

$client = new Client( array(
		'base_uri' => sprintf( '%s/wp-json/wc/v2/', rtrim( $user_info['site_url'], '/' ) ),
		'handler' => $stack,
		'auth' => 'oauth',
	)
);

$client->post( 'products',
	array(
		'json' => array(
			'name' => $cart_good['goods_name'],
			'type' => 'simple',
			'regular_price' => $cart_good['shop_price'],
			'description' => $cart_good['goods_desc'],
		)
	)
);

Hi there, this library used to work with previous version of woocommerce.
After i update woocommerce to latest version, it completely not working.
I keep getting invalid signature

Wordpress : 4.8
Woocommerce : 3.1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant