How to force JWT auth for default GET endpoints of WordPress rest api?
The default GET
endpoints (for e.g. http://scintec.net/wp-json/wp/v2/posts/) of the WordPress Rest api are public and can be accessed by anyone.
I am currently interacting with a WordPress Rest api where I am using JWT authentication for POST
requests.
I don’t want my GET
endpoints to be public and they should also require the JWT token in order to pass the request. How can this be done? I went through the documentation on this page https://developer.wordpress.org/rest-api/using-the-rest-api/authentication/ but didn’t find anything in this regard.
Also I am using the JWT Authentication for WP REST API plugin for JWT auth.
Leave an answer