WooCommerce REST API Authentication is failing when I am logged into Wordpress in the same browser.
Log out - everything works
Log in - and get this error:
{"code":"woocommerce_rest_cannot_view","message":"Sorry, you cannot view this resource.","data":{"status":401}}
Same goes for Ajax:
jQuery.ajax({
url:'https://example.com/wp-json/wc/v1/products/30552?consumer_key=ck_xxx&consumer_secret=cs_xxx',
success:function(d){window.d = d;}
});
and when trying to access the same URL directly in the browser.
What could be causing this situtation?
I can't think of any useful reason for it.