Introducing G2.ai, the future of software buying.Try now

name spaces, hardening, blocking accessing to certain woocommerce rest apis

I've read this wpcerber section: https://wpcerber.com/restrict-access-to-wordpress-rest-api/ I have enabled: Block access to users' data via REST API as well as Block access to WordPress REST API except any of the following. My namespaces show as follows: { "namespaces": [ "oembed/1.0", "2fa/v1", "contact-form-7/v1", "yoast/v1", "mc4wp/v1", "wc/store", "wc-analytics", "wc-admin", "testwp", "elementor/v1", "wc/v1", "wc/v2", "wc/v3", "wccom-site/v1", "wp/v2", "wp-site-health/v1" ] } I want to allow Woo Rest API version 3 access and so I have tried adding wc/v3 as well as wc/v3/products to allowed namespaces but when I try to access the api, I am getting the 401 message. // 20201221161556 // https://fee8f3a621.nxcli.net/wp-json/wc/v3/products { "code": "woocommerce_rest_cannot_view", "message": "Sorry, you cannot list resources.", "data": { "status": 401 } } What am I doing wrong?
1 comment
Looks like you’re not logged in.
Users need to be logged in to answer questions
Log In
Cerber Security, Antispam & Malware Scan
Official Response
Cerber Security, Antispam & Malware Scan
Gregory M.
GM
Keep moving forward
0
You have to add to the white list "wc", not "wc/v3". Meaning WP Cerber makes no distinction between versions in the namespaces. As a namespace, you have to specify the string before the first slash /.
Looks like you’re not logged in.
Users need to be logged in to write comments
Log In
Reply